> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# syncDinoAiAgentDefinitionsFromCode

> Starts a job that imports, by slug, the DinoAI agent definitions committed under `.dinoai/agents/` into the workspace the key targets: a workspace key's own, or the one in the `X-Paradime-Workspace` header. It creates agents and replaces those with the same slug, and never deletes. The branch's files replace an agent with the same slug even when it was authored in Paradime or through this API. Poll the job with `adminJob`. Needs `dinoai:admin:write`.



**mutation** `syncDinoAiAgentDefinitionsFromCode(input: SyncDinoAiAgentDefinitionsFromCodeInput!): SyncDinoAiAgentDefinitionsFromCodePayload!`

## Arguments

**`input`**: `SyncDinoAiAgentDefinitionsFromCodeInput!` (required)

The branch to read.

## Returns

`SyncDinoAiAgentDefinitionsFromCodePayload!`

**`job`**: `AdminJob!`

The sync's job. Its `result` is a `DinoAiAgentSyncResult`: the agents created and updated, the files skipped as invalid, the branch and commit read, and whether the repository was fetched first.

## Examples

```graphql Mutation
mutation SyncDinoAiAgentDefinitionsFromCode($input: SyncDinoAiAgentDefinitionsFromCodeInput!) {
  syncDinoAiAgentDefinitionsFromCode(input: $input) {
    job {
      id
      kind
      status
      failure {
        code
        reason
      }
      result {
        __typename
        ... on DeployBoltSchedulesResult {
          __typename
        }
      }
      createdAt
    }
  }
}
```

```json Variables
{
  "input": {}
}
```

```json Response
{
  "data": {
    "syncDinoAiAgentDefinitionsFromCode": {
      "job": {
        "id": "string",
        "kind": "DEPLOY_BOLT_SCHEDULES",
        "status": "QUEUED",
        "failure": {
          "code": "UNAUTHENTICATED",
          "reason": "string"
        },
        "result": {
          "__typename": "DeployBoltSchedulesResult"
        },
        "createdAt": "value"
      }
    }
  }
}
```


## Related topics

- [Administration API: DinoAI](https://docs.paradime.io/developers/graphql-api/admin-api/dinoai.md)
- [Administration API: Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md)
- [Admin client: jobs](https://docs.paradime.io/developers/python-sdk/modules/admin/jobs.md)
- [Admin client: DinoAI](https://docs.paradime.io/developers/python-sdk/modules/admin/dinoai.md)
- [PR reviewer with the DinoAI GitHub Action](https://docs.paradime.io/guides/programmable-agents/github-action-pr-reviewer.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.