--- title: 'Push API tutorial 1: Manage public content' slug: '92' canonical_url: https://docs.coveo.com/en/92/ collection: index-content source_format: adoc --- # Push API tutorial 1: Manage public content For this tutorial, you'll be working with a [public](https://docs.coveo.com/en/1779/) Push source. Any [user](https://docs.coveo.com/en/250/) who can perform [queries](https://docs.coveo.com/en/231/) in a [Coveo organization](https://docs.coveo.com/en/185/) can see the items of a public source in their query results. You'll add a single basic [item](https://docs.coveo.com/en/210/) to your public Push [source](https://docs.coveo.com/en/246/) and then delete it. You'll also learn how to update the status of a Push source to generate coherent [activity](https://docs.coveo.com/en/173/) logs. ## Prerequisites You need the setup described in the [Push API Tutorials](https://docs.coveo.com/en/161#tutorial-setup) article. ## Step 1: (Optional) Generate your first source activity logs For non-Push sources, the Coveo [crawlers](https://docs.coveo.com/en/2121/) automatically take care of generating [activity logs](https://docs.coveo.com/en/1969/) in your Coveo organization. However, you're fully responsible for managing the activity logs of your Push sources. When you plan to make Push API requests to update the content of a Push source, update that source's status first. You'll now send a [`Set the status of a Push source`](https://docs.coveo.com/en/35#update-the-status-of-a-push-source) request to set the status of your Push source to `REBUILD`. . In your preferred HTTP client, create a new POST request using the Push API endpoint corresponding to your deployment region. -- **US East region** [%collapsible%open] #### [source,http,subs=attributes] ``` POST https://api.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ``` #### .Canada region
Details [source,http,subs=attributes] ``` POST https://api-ca.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Ireland region**
Details [source,http,subs=attributes] ``` POST https://api-eu.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Australia region**
Details [source,http,subs=attributes] ``` POST https://api-au.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
-- . Configure the request.
Postman

You should have set the proper values for the following Postman collection variables during the setup:

  • baseUrl

  • organizationId

  • sourceId

  • apiKey

The statusType parameter and its value are specified in the endpoint URL query string.

All the necessary variables should therefore already be set for this request.

** Set the `organizationId` and `sourceId` path parameters to the values you noted in the [Push API Tutorials setup](https://docs.coveo.com/en/161#tutorial-setup) article. ** Set the `statusType` query parameter value to `REBUILD`. ** Use your API key as the `Authorization` header `accessToken` value. . Send the request. On the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/), after the processing delay, you should see that the status of your Push source change from _Ready to receive content_ to _Retrieving content_. > **Note** > > Typically, you shouldn't bother to update the status of a Push source when you're only performing tests, which is why this tutorial step is optional. > > You won't be asked to generate source activity logs in the next tutorials. ## Step 2: Add an item to your source You'll now send an [`Add or update an item`](https://docs.coveo.com/en/133#add-or-update-a-basic-public-item) request to add a dummy item to your Push source. . In your HTTP client, create a new PUT request using the Push API endpoint corresponding to your deployment region. -- **US East region** [%collapsible%open] #### [source,http,subs=attributes] ``` POST https://api.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Content-Type: application/json Accept: application/json Authorization: Bearer {accessToken} ``` #### .Canada region
Details [source,http,subs=attributes] ``` POST https://api-ca.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Content-Type: application/json Accept: application/json Authorization: Bearer {accessToken} ```
**Ireland region**
Details [source,http,subs=attributes] ``` POST https://api-eu.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Content-Type: application/json Accept: application/json Authorization: Bearer {accessToken} ```
**Australia region**
Details [source,http,subs=attributes] ``` POST https://api-au.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Content-Type: application/json Accept: application/json Authorization: Bearer {accessToken} ```
-- . Configure the request.
Postman

In the Coveo Push API Tutorials collection, all the necessary variables and payload have already been set for this request.

** Set the `organizationId` and `sourceId` path parameters to the values you noted in the [Push API tutorials setup](https://docs.coveo.com/en/161#tutorial-setup) article. ** Use your API key as the `Authorization` header `accessToken` value. ** Set the `documentId` query parameter value to `+file://folder/dummyItem.txt+`. This URI doesn't reference an existing item, but that's acceptable since you're only pushing fictitious content. ** Use the following JSON as your request body. ```json { "data": "This is a dummy item." } ``` . Send the request. You should receive a `202` response, but you may have to [wait a few minutes](https://docs.coveo.com/en/32/) before the item you added becomes available in your source. > **Note** > > A successful Push API response only confirms that the request was accepted for processing—it doesn't guarantee that the operation was completed successfully. > Failures can still occur downstream in the [Coveo indexing pipeline](https://docs.coveo.com/en/184/). > For example, an item may be rejected due to validation rules or unsupported content. > Many downstream failures can only be observed through the [**Log Browser**](https://platform.cloud.coveo.com/admin/#/orgid/logs/browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/logs/browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/logs/browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/logs/browser/)) in the [Coveo Administration Console](https://docs.coveo.com/en/183/). > > ![Log Browser showing permissions error | Coveo](:https://docs.coveo.com/en/assets/images/index-content/log-browser-example.png) > > For complete troubleshooting guidance, see the [Troubleshooting Push source issues](https://docs.coveo.com/en/95/) article. ## Step 3: Validate the indexing status of the item To validate whether the item you added in [step 2](#step-2-add-an-item-to-your-source) has been processed successfully, you'll now use the [**Content Browser**](https://platform.cloud.coveo.com/admin/#/orgid/content/browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/browser/)). For more information, see [Inspect items with the Content Browser](https://docs.coveo.com/en/2053/). . In the [Coveo Administration Console](https://docs.coveo.com/en/183/), access the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page. . On the Push source row, click **Open in Content Browser**. ![Show source items in the Content Browser](https://docs.coveo.com/en/assets/images/index-content/open-in-content-browser.png) If you see the item in the **Content Browser** after the [processing delay](https://docs.coveo.com/en/32/), move on to the next step of this tutorial. > **Note** > > A successful Push API response only confirms that the request was accepted for processing—it doesn't guarantee that the operation was completed successfully. > Failures can still occur downstream in the [Coveo indexing pipeline](https://docs.coveo.com/en/184/). > For example, an item may be rejected due to validation rules or unsupported content. > Many downstream failures can only be observed through the [**Log Browser**](https://platform.cloud.coveo.com/admin/#/orgid/logs/browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/logs/browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/logs/browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/logs/browser/)) in the [Coveo Administration Console](https://docs.coveo.com/en/183/). > > ![Log Browser showing permissions error | Coveo](:https://docs.coveo.com/en/assets/images/index-content/log-browser-example.png) > > For complete troubleshooting guidance, see the [Troubleshooting Push source issues](https://docs.coveo.com/en/95/) article. ## Step 4: Remove the item from your source To begin [Push API tutorial 2: Manage secured content](https://docs.coveo.com/en/98/) with a clean source, you'll now send a [`Delete an item and optionally its children`](https://docs.coveo.com/en/171/) request to remove the item you added in [step 2](#step-2-add-an-item-to-your-source). . In your HTTP client, create a new DELETE request using the Push API endpoint corresponding to your deployment region. -- **US East region** [%collapsible%open] #### [source,http,subs=attributes] ``` POST https://api.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ``` #### .Canada region
Details [source,http,subs=attributes] ``` POST https://api-ca.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Ireland region**
Details [source,http,subs=attributes] ``` POST https://api-eu.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Australia region**
Details [source,http,subs=attributes] ``` POST https://api-au.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
-- . Configure the request.
Postman

In the Coveo Push API Tutorials collection, all the necessary variables have already been set for this request.

** Set the `organizationId` and `sourceId` path parameters to the values you noted in the [Push API Tutorials setup](https://docs.coveo.com/en/161#tutorial-setup) article. ** Use your API key as the `Authorization` header `accessToken` value. ** Set the `documentId` query parameter value to `+file://folder/dummyItem.txt+`. > **Note** > > You don't need to include the `deleteChildren` query parameter in your request. > The `deleteChildren` parameter's default value is `false`. . Send the request. You should receive a `202` response. As in [step 3](#step-3-validate-the-indexing-status-of-the-item), use the [**Content Browser**](https://platform.cloud.coveo.com/admin/#/orgid/content/browser/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/browser/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/browser/)) to confirm that the item has been deleted from your source. You can then proceed to the next step of this tutorial. ## Step 5: (Optional) Generate more source activity logs Your source content update is complete so you'll now use the [`Set the status of a Push source`](https://docs.coveo.com/en/35#update-the-status-of-a-push-source) request to set the status of your Push source back to `IDLE`. If you don't perform this status update, the source status in the [Coveo Administration Console](https://docs.coveo.com/en/183/) will remain _Retrieving content_ indefinitely. . In your HTTP client, create a new POST request using the Push API endpoint corresponding to your deployment region. -- **US East region** [%collapsible%open] #### [source,http,subs=attributes] ``` POST https://api.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ``` #### .Canada region
Details [source,http,subs=attributes] ``` POST https://api-ca.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Ireland region**
Details [source,http,subs=attributes] ``` POST https://api-eu.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
**Australia region**
Details [source,http,subs=attributes] ``` POST https://api-au.cloud.coveo.com/push/v1/organizations/{organizationId}/sources/{sourceId}/status?statusType={statusType} HTTP/1.1 ​ Accept: application/json Authorization: Bearer {accessToken} ```
-- . Configure the request.
Postman

In the Coveo Push API Tutorials collection, all variables that this request requires are already set.

** Set the `organizationId` and `sourceId` path parameters to the values you noted in the [Push API Tutorials setup](https://docs.coveo.com/en/161#tutorial-setup) article. ** Set the `statusType` query parameter value to `IDLE`. ** Use your API key as the `Authorization` header `accessToken` value. . Send the request. On the [**Sources**](https://platform.cloud.coveo.com/admin/#/orgid/content/sources/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/content/sources/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/content/sources/)) page, after the processing delay, you should see the source status return to _Ready to receive content_. ![Source status is Ready to receive content | Coveo Platform](https://docs.coveo.com/en/assets/images/index-content/ready-to-receive.png) ## What's next? Proceed to [Push API tutorial 2: Manage secured content](https://docs.coveo.com/en/98/).