# Instagram publish status

> Poll a staged Instagram publish until it completes or fails.

Canonical: <https://www.tryadeli.com/docs/api/posts/get-instagram-publish-status>

`GET https://app.tryadeli.com/api/v1/posts/instagram/status`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

Polls an Instagram post that [Publish to Instagram](https://www.tryadeli.com/docs/api/posts/publish-instagram)
accepted with `202`. The job is scoped to the API key's organization and the
selected profile.

**Query parameters**

| Name        | Type   | Required | Description                                                                              |
| ----------- | ------ | -------- | ---------------------------------------------------------------------------------------- |
| `jobId`     | `uuid` | Yes      | From the accepted publish response.                                                      |
| `profileId` | `uuid` |          | The profile returned with the job. Omit only when the organization has a single profile. |

`status` is `queued`, `processing`, `published`, `failed`, or
`outcome_unknown`. Keep polling while it is `queued` or `processing`. A
`published` response carries the normalized `post`. A `failed` response carries
a sanitized `error`. `outcome_unknown` means Meta may have accepted the final
publish write but Adeli did not receive its response; Adeli does not retry that
write because doing so could create a duplicate post.

Responses use `cache-control: no-store`. A job outside the authenticated
organization/profile scope returns `404`, so job IDs do not reveal another
tenant's publication state.

## Request examples

**cURL**

```bash
curl "https://app.tryadeli.com/api/v1/posts/instagram/status?jobId=00000000-0000-4000-8000-000000000002&profileId=00000000-0000-4000-8000-000000000001" \
  -H "Authorization: Bearer $ADELI_API_KEY"
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/posts/instagram/status?jobId=00000000-0000-4000-8000-000000000002&profileId=00000000-0000-4000-8000-000000000001", {
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
  },
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.get(
    "https://app.tryadeli.com/api/v1/posts/instagram/status",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "jobId": "00000000-0000-4000-8000-000000000002",
        "profileId": "00000000-0000-4000-8000-000000000001",
    },
)
print(response.json())
```

## Responses

### 200

```json
{
  "jobId": "00000000-0000-4000-8000-000000000002",
  "platform": "instagram",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "profileId": "00000000-0000-4000-8000-000000000001",
  "status": "published",
  "statusUrl": "/api/v1/posts/instagram/status?jobId=00000000-0000-4000-8000-000000000002&profileId=00000000-0000-4000-8000-000000000001",
  "post": {
    "providerId": "17900000000000000",
    "permalink": "https://www.instagram.com/p/..."
  }
}
```

### 200

```json
{
  "jobId": "00000000-0000-4000-8000-000000000002",
  "platform": "instagram",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "profileId": "00000000-0000-4000-8000-000000000001",
  "status": "failed",
  "statusUrl": "/api/v1/posts/instagram/status?jobId=00000000-0000-4000-8000-000000000002&profileId=00000000-0000-4000-8000-000000000001",
  "error": {
    "code": "provider_rejected",
    "message": "Instagram could not process this media"
  }
}
```

### 404

```json
{
  "error": {
    "code": "not_found",
    "message": "Instagram publish job not found"
  }
}
```
