> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingest an API

> Ingest an API into NexusOne by pulling data from a SaaS endpoint and storing its responses as tables in an Iceberg lakehouse.

Ingesting an API means pulling data from a SaaS platform's API endpoint, transforming the
responses into data streams, and then storing each stream as a table in NexusOne's Iceberg lakehouse.

This guide walks you through how to ingest an API.

## Prerequisites

* Appropriate permission: `nx1_ingest`, `nx1_monitor`, `nx1_s3_admin`, `airflow_user`, `superset_user`,
  `spark_sql`, and `trino_admin`
* Ensure you are ingesting APIs from a [SaaS platform that NexusOne currently supports](../../overview/ingest#how-api-ingestion-works).

## Select an API source

<Tabs>
  <Tab title="Web portal" icon="browser">
    Selecting an API source is equivalent to selecting the SaaS platform you'll be ingesting data from.

    1. Log in to NexusOne.

    2. On the top navigation bar, hover your mouse over **Data Pipeline** and then select **Ingest**.

    3. Click **API**.

    4. In the **Source** section, select a source connector from the drop-down list.

    5. Depending on the connector you select, enter its authentication configuration details.

    6. Optional: In the **Streams** section, enter a comma-separated list of stream names you want to sync.

    7. In the **Destination** section, enter a job name.

    8. Enter a target schema name.

    9. Optional: Set how often the ingestion job should run. Schedule options include `Run Once`,
       `Every 3 hours`, `Daily`, `Weekly`, `Monthly`, and `Quarterly`.

    10. Select a mode for how to store incoming records at the destination table.
        * **Append**: Add new records to the existing dataset.
        * **Merge**: Add or update existing records where applicable.
        * **Overwrite**: Replace all existing records.

    11. Optional: Select a DataHub domain. For example, `Company`, `Product`, `Sales`. This is only applicable if you have one previously
        [created on DataHub](https://docs.datahub.com/docs/domains) via the Govern feature on NexusOne.

    12. Optional: Select or create one or more tags to label this job.

    13. Optional: Column transformations:

        * Click **Add Transformation**, then select any of the following column transformation types:

          * **Cast**: Converts a column's data type during ingestion. To use this transformation type,
            enter the column name in the **Column** field, and then select a target type in the **Target Type**.
          * **Drop**: Removes a column from the dataset. To use this transformation type, enter the column
            name in the **Column** field.
          * **Encrypt**: Makes the data unreadable using an encryption key. To use this transformation type,
            enter the column name in the **Column** field, and then optionally enter a key name in the **Key Name**
            field.
          * **Rename**: Changes a column's name. To use this transformation type, enter the column name in
            the **Column** field, and then enter a new column name in the **New Name** field.

        * Repeat until you have added all the transformations necessary for your use case.

    14. After configuring all fields, click **Ingest** to submit the job.
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoint to:

    * [Create a new PyAirbyte data ingestion job](/api-reference/endpoints/pyairbyte-ingestion/create-pyairbyte-ingestion-job)

    If you are selecting an existing source connector or multiple ones, you can use the following
    API endpoints to:

    * [Get source details](/api-reference/endpoints/pyairbyte-ingestion/get-source-details)
    * [List available PyAirbyte sources](/api-reference/endpoints/pyairbyte-ingestion/list-available-pyairbyte-sources)
  </Tab>
</Tabs>

## Monitor, trigger, or delete a job

When you schedule an ingested API, it runs as a job in Apache Airflow.
You can monitor, trigger, or delete the job.

<Tabs>
  <Tab title="Web portal" icon="browser">
    1. When you create a job, a success message and a View Jobs button appear.
    2. Track the job status by clicking **View Jobs** or navigating to the NexusOne homepage
       and clicking **Monitor**.
    3. Use the three dots `...` menu to trigger or delete a job.
    4. If you clicked **Trigger job**, then click the job's name to open its DAG details in Airflow's portal.
  </Tab>

  <Tab title="CLI" icon="square-terminal">
    Use the following `nx1` command to:

    * [View all jobs](/cli-reference/nx1/jobs#list).
    * [View a job](/cli-reference/nx1/jobs#get).
    * [Trigger a job](/cli-reference/nx1/jobs#trigger).
    * [Delete a job](/cli-reference/nx1/jobs#delete).
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoints to:

    * [View all jobs](/api-reference/endpoints/jobs/get-jobs).
    * [View a job](/cli-reference/nx1/jobs#get).
    * [Trigger a job](/api-reference/endpoints/jobs/trigger-job).
    * [Delete a job](/api-reference/endpoints/jobs/delete-job).
  </Tab>
</Tabs>

## Additional resources

* To understand how API ingestion works in NexusOne, refer to
  [How API ingestion works](/documentation/data-pipeline/overview/ingest).
* For more information about the monitoring feature, refer to the
  [Monitor Overview](/documentation/platform/overview/monitor) page.
* For more information about roles or permissions, refer to the
  [Govern Overview](/documentation/govern/overview) page.
