# API Reference: Publish

## Publish API

> Authentication: The Publish API uses the same authentication as the Hookdeck REST API (`Authorization: Bearer $API_KEY` or Basic Auth). This is different from Source authentication - when sending directly to Source URLs, see [Source Authentication](/docs/authentication#source-authentication).

The Hookdeck Publish API is a distinct endpoint to send requests to one of your Hookdeck sources, either by name or by ID. The Publish API is authenticated just like the rest of the Hookdeck API.

Requests sent via the Publish API are automatically considered `verified` and do not require additional verification. If your Source Type is set to Hookdeck Publish API (`PUBLISH_API` via API), only requests via the Publish API will be accepted. Regardless of the source type and authentication method, it's always possible to send requests via the Publish API for any given source.

The Publish API has its own specification and no rate limit.

The API URL is `https://hkdk.events/v1/publish`

### Required headers

The following headers are required for all requests to the Publish API. Those reserved headers will be trimmed from the request once validated.

* `Authorization`: The value of this header is the `Authorization` header value from the request you wish to publish.
* `Content-Type`: The value of this header is the `Content-Type` header value from the request you wish to publish. Must be one of Hookdeck supported content types.

You must include one of the following headers:

* `X-Hookdeck-Source-Id`: The value of this header is the `id` of the source you wish to publish the request to.
* `X-Hookdeck-Source-Name`: The value of this header is the `name` of the source you wish to publish the request to.

### Behavior

The Publish API does not have a specification beyond the required headers. The Publish API will accept any request valid for the Source it is published to, and the headers, body, path, and query params will be passed through as is.

#### Path

For example, if you `POST` to `/v1/publish/orders`, the `path` value will be `/orders`. This path will be forwarded to the destination endpoint unless the Hookdeck Destination has Path forwarding disabled.


```bash
curl -X POST "https://hkdk.events/v1/publish" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -H "X-Hookdeck-Source-Id: src_12n4ffxk8adnqqj" \
  -d '{"order_id": "1234567890"}'

```

```bash
curl -X POST "https://hkdk.events/v1/publish" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -H "X-Hookdeck-Source-Name: account-123" \
  -d '{"order_id": "1234567890"}'

```