# Retrieve publication status

URL: https://api-docs.vestta.io/properties/publication-status

Check requested visibility, processing state and marked images.

`status` is `private`, `pending`, `processing`, `published`, `ready` or `failed`. `requested` is desired catalogue visibility; `published` is effective visibility. `ready` means public copies are available for an export without publishing the property. New photos are watermarked; migration-grandfathered photos retain their unmarked copies.

While pending or processing, poll every two seconds. When `failed`, inspect the safe `error` code, fix the cause and repeat the publication request. Automatic retries are bounded; do not busy-loop failed requests.

### GET /v1/properties/{property_id}/publication

Returns processing status and opaque public image URLs, including approved legacy copies. Requires the `properties:publish` scope.

Required scope: `properties:publish`

Path parameters:
- `property_id` (integer, required, ≥ 1)

Response 200: Successful response.
- `status` (string, optional, default ok, values: `ok`)
- `data` (PublicationState, required)
  - `status` (string, required, values: `private` | `pending` | `processing` | `published` | `ready` | `failed`)
  - `published` (boolean, required)
  - `requested` (boolean, required)
  - `images` (array of objects, optional)
    - `id` (string, required)
    - `url` (string, required): Permanent opaque public-copy URL. New photos are watermarked; migrated legacy copies may remain unmarked. Never an original or upload URL.
    - `order` (integer, optional, default 1)
    - `is_primary` (boolean, optional, default false)
    - `title` (string, optional, default )
  - `error` (string, optional, nullable): Safe diagnostic code. Retry the same publication request after correcting the cause.

```json
{
  "status": "ok",
  "data": {
    "status": "private",
    "published": false,
    "requested": false,
    "images": []
  }
}
```

Response 401: The API key is missing, malformed, unknown, revoked or expired.

Response 403: The API key lacks the required scope, or the business plan does not include API access.

Response 404: The resource does not exist in this business.

Response 409: Duplicate contact or idempotency key reused with a different payload.

Response 422: A path parameter, query parameter or body field is invalid.

Response 429: The API key reached its request limit. Wait for the number of seconds in `Retry-After` before retrying.

Response 500: Unexpected server error while processing the request.

### Example requests

#### cURL

```bash
curl "https://api.vestta.io/v1/properties/1/publication" \
  -H "X-Api-Key: $VESTTA_API_KEY"
```

#### JavaScript

```javascript
const response = await fetch('https://api.vestta.io/v1/properties/1/publication', {
  headers: { 'X-Api-Key': process.env.VESTTA_API_KEY },
})

const data = await response.json()
```

#### Python

```python
import os

import requests

response = requests.get(
    "https://api.vestta.io/v1/properties/1/publication",
    headers={"X-Api-Key": os.environ["VESTTA_API_KEY"]},
)
response.raise_for_status()
data = response.json()
```
