# Register CI for a repository without changing it

> Page: https://docs.plotwork.dev/api/post-orgs-org-github-repositories-id-trust. Index of every page: https://docs.plotwork.dev/llms.txt

Adds the trusted publisher alone, for the repository's own Plotwork workflow file or diagrams.yml, with GitHub ids pinned, and opens no pull request.

`POST /orgs/{org}/github/repositories/{id}/trust`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Register CI for a repository without changing it. |
| What does it take? | `org`, `id` in the path. |
| What does it return? | Status 200 with a body of type [`GithubTrust`](https://docs.plotwork.dev/api/schemas.md#githubtrust). |
| What can go wrong? | `401` not signed in; `403` a member may not (orgs.forbidden), the plan has no GitHub App (plan.github_app_not_included), or the request came from an origin that may not make changes; `404` no such organisation or repository (github.repository_not_found); `409` the installation is suspended on GitHub (github.suspended); `429` too many requests, or GitHub asked to wait (github.rate_limited); `502` GitHub could not be reached (github.unavailable); `503` the GitHub App is not set up on this server (github.not_configured), or organisations are not. Every failure uses the one error envelope. |

## What it does

Adds the trusted publisher alone, for the repository's own Plotwork workflow file or diagrams.yml, with GitHub ids pinned, and opens no pull request. The owner and an admin, on Pro and Enterprise.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |
| `id` | `string` | yes | GitHub's id. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The trusted publisher. | [`GithubTrust`](https://docs.plotwork.dev/api/schemas.md#githubtrust) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | A member may not (orgs.forbidden), the plan has no GitHub App (plan.github_app_not_included), or the request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation or repository (github.repository_not_found). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | The installation is suspended on GitHub (github.suspended). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests, or GitHub asked to wait (github.rate_limited). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 502 | GitHub could not be reached (github.unavailable). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | The GitHub App is not set up on this server (github.not_configured), or organisations are not. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`GithubTrust`](https://docs.plotwork.dev/api/schemas.md#githubtrust).

| Field | Type | Required | Description |
|---|---|---|---|
| `trustedPublisher` | `object \| null` | yes | The trusted publisher, or null when the organisation has twenty already. |
| `trustedPublisher.id` | `string` | yes |  |
| `trustedPublisher.name` | `string` | yes |  |
| `trustedPublisher.created` | `boolean` | yes |  |
| `workflow` | `string` | yes | The workflow file it trusts: the repository's own Plotwork workflow, else diagrams.yml. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
