---
docId: doc_6412e57b9aa94b9d9a3141f089254380
title: Choose the suites on publish
description: Connect suites to an agent so they run on their own every time it is published. They do not block publishing.
api:
  group: agentes/evals/al-publicar
  auth: bearer
  operations:
    - operationId: setEvalOnPublish
      method: PUT
      path: '/v1/agents/{agentId}/evals/on-publish'
      postmanName: Choose the suites on publish
---

<script>
  import { Ways, Note, Collapsible } from '$lib/components';
</script>

# Choose the suites on publish

Choose up to 10 [suites](/api-reference/evals) to test the agent after each [publication](/api-reference/agents/publications/publish). Send the complete list in `suiteIds`; it replaces the previous list. Send `[]` to remove all suites.

Tests run against the version that is already published. If they fail, that version stays published.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PUT "https://api.platic.ai/v1/agents/$AGENT_ID/evals/on-publish" \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "suiteIds": ["s8Kd2LmQ"]
}'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.evals.onPublish.set("agent_123", { suiteIds: ["suite_123"] });
```

</Ways.Way>
</Ways>



## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent ID | ✓ |

## Request body

```json
{
  "suiteIds": ["s8Kd2LmQ"]
}
```

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `suiteIds` | array | Up to 10 suites, each one once. An empty list disconnects all of them: none runs on publish. | ✓ |

<Note type="note">

Before saving, Platica checks that every suite exists and is active. A missing or archived suite returns `409 EVAL_SUITE_STALE`, and the change is not saved.

</Note>

## Response

`200` with the new list:

```json
{
  "status": "success",
  "data": {
    "suiteIds": ["s8Kd2LmQ"],
    "updatedAt": "2026-11-01T10:20:31.000Z"
  }
}
```

## Response fields

The same as in [Get the suites on publish](/api-reference/evals/on-publish/get#response-fields).

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | The body is not valid; for example, more than 10 suites. |
| `404` | `AGENT_NOT_FOUND` | The agent does not exist or belongs to another workspace. |
| `409` | `EVAL_SUITE_STALE` | One of the suites does not exist or is archived. Nothing is saved. |
| `409` | `CONFLICT` | Someone else changed this at the same time. Try again. |

## Notes

- Saving the list does not run anything: the suites run on the next publish.
- **They do not block publishing.** They run **after** the publication is confirmed, as the person who published. If a run fails, the version stays published.
- Their runs appear in [List runs](/api-reference/evals/runs/list) with `trigger: "on_publish"`.
- They cost like any run: they use the agent's real tools and each agent turn is charged as an internal message.
- This list belongs to the agent, but it is not part of its versions: it changes immediately, without publishing.
- It requires permission to edit the agent, the same as to publish.

## If a suite cannot start

<Collapsible summary="Retries, capacity and permanent failures">

- If there is no capacity on publish (`EVAL_CAPACITY`) or the service does not respond, the suite can retry up to 10 times. The delay starts at 30 seconds and doubles up to a maximum of 1 hour. Retrying is triggered by the next interaction with the agent: publishing, returning to a previous version, or reading its runs or launches. A suite with this problem does not stop the others.
- If a suite can never run (for example, it was archived, one of its scenarios no longer exists or its profile does not exist), or the 10 retries are used up, it is marked as failed with its error code and is not retried.

</Collapsible>
