# Publish a procedure

```http
POST https://trydimmi.com/api/v1/procedures/{procedure}/publications
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `ai:write`.

## Path parameters

- `procedure` (string, required): Id of the AI agent procedure, starting with prc_, such as prc_01jx2m8k4t. Find it with GET /procedures.

## Body

- `change_note` (string): An optional short note on what changed, kept with the version this publish creates. At most 500 characters, such as "Added the refund limit check before the refund step".

## Response 200 (OK)

- `data` (object, required)
  - `created_at` (string, required): When it was created, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `definition` (any, required): The procedure's working copy as a JSON object: the draft being edited, which may differ from what dimmi follows.
  - `has_unpublished_changes` (boolean, required): True when the procedure is live and its working copy differs from the published one dimmi follows.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `lock_version` (integer, required): Version counter of the working copy; send the value you read when saving so a newer save is not overwritten.
  - `name` (string, required): Name of the procedure.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `published_at` (string | null, required): When it was last published. Null when it never was.
  - `status` (string, required): draft when it was never published, live when dimmi follows its published version.
  - `updated_at` (string, required): When it last changed, as an RFC 3339 time, such as 2026-01-31T09:00:00Z.
  - `uses` (integer, required): How often dimmi followed the procedure in the last 30 days.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/procedures/{procedure}/publications' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "change_note": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "created_at": "2026-11-01T09:30:00Z",
    "definition": null,
    "has_unpublished_changes": true,
    "id": "<string>",
    "lock_version": 123,
    "name": "<string>",
    "object": "<string>",
    "published_at": "2026-11-01T09:30:00Z",
    "status": "<string>",
    "updated_at": "2026-11-01T09:30:00Z",
    "uses": 123
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
