Agentsai-org
GET/ai-profile-drafts/{draft_id}
A persona draft, and once it is written, the persona.
get_ai_profile_draft
ai_org:manage
A token needs theai_org:managescope: Configure and operate an AI organization: drafts, pausing, suspending, sessionsGranted bywrite_api.Every operation this scope unlocks
Only the person who asked for the draft can read it.
Parameters
Path
- draft_idAiProfileDraftId (string · uuid)The persona draft
Responses
200The draftapplication/json
- briefProfileDraftBrief (string)What was asked for.
- cost_microsinteger · int64What it cost, fee included, in micro-dollars.
- created_atstring · date-timeWhen it was asked for.
- draft_idAiProfileDraftId (string · uuid)The draft.
- org_idAiOrgId (string · uuid)The organization it was written for.
repositoriesarray of ProfileDraftRepositoryThe repositories it reads.
- The ProfileDraftRepository schema
- full_pathstringIts path as addresses name it, as it is now.
- repository_idRepositoryId (string · uuid)The repository.
- stateAiProfileDraftStatequeuedrunningreadyfailedWhere it stands.
- completed_atstring · date-time or nulloptionalWhen it was finished.
- failureAiProfileDraftFailurebudget_exhaustedrefusedaccess_changedtimed_outcancellederroror nulloptionalWhy it was not written, when it failed.
- model_idAiModelKey (string) or nulloptionalThe model it is written with: the one asked for, else the economical tier's default once the draft starts.
- personaAgentPersona (string) or nulloptionalThe persona, once it is written: put it in the agent's
profile.personain the revision draft, edited as you see fit. - positionPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writeror nulloptionalThe position that was asked for, when one was.
sourcesarray of ProfileDraftSourceoptionalThe files the persona drew on.
- The ProfileDraftSource schema
- pathFilePath (string)The file's path on the repository's default branch.
- repository_idRepositoryId (string · uuid)The repository the file is in.
- summaryProfileDraftSummary (string) or nulloptionalWhat the drafted agent does, in one line, once it is written.
- written_forPositionengineerreviewerproduct_ownerdirectorrelease_managertechnical_writeror nulloptionalThe position the persona is written for, once it is written.
200 exampleSynthesized example
{
"brief": "brief-702f",
"cost_micros": 9,
"created_at": "2026-10-09T18:27:13Z",
"draft_id": "6c079065-6bfa-4679-a180-6135adcf9aba",
"org_id": "bdff6026-46cf-4576-8814-ee4f8ed46cc9",
"repositories": [
{
"full_path": "acme/payments-api",
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70"
}
],
"state": "queued",
"completed_at": "2026-10-13T18:15:12Z",
"failure": "budget_exhausted",
"model_id": "ddcb9234-6722-4900-9308-e01025fe2e77",
"persona": "persona-e5d8",
"position": "engineer",
"sources": [
{
"path": "path-b6ea",
"repository_id": "5b0e7c2a-9d14-4e8b-a6f1-2c3d4e5f6a70"
}
],
"summary": "summary-58e4",
"written_for": "engineer"
}
400Bad request — a path parameter is not a well-formed value of its typeapplication/json
Error codes
- BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-f61f",
"message": "Label every synthesized example"
}
}
401Unauthenticated — no credential, or an invalid oneapplication/json
Error codes
- UNAUTHORIZEDNo credential was sent, or the one sent is invalid, expired or revoked
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
401 exampleSynthesized example
{
"error": {
"code": "code-8177",
"message": "Label every synthesized example"
}
}
403Forbidden — the caller's access level or token scope is insufficientapplication/json
Error codes
- FORBIDDENYou are signed in but may not do this here;
reasonnames the permission or the rule that refused it - INSUFFICIENT_SCOPEThe access token lacks the scope this operation needs;
required_scopenames it - PERMISSION_REQUIREDYou need a permission you do not hold here; the message names it
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
403 exampleSynthesized example
{
"error": {
"code": "code-9f8c",
"message": "Inline scalar newtypes but keep their brand"
}
}
404application/json
Error codes
- NOT_FOUNDThe resource does not exist — or exists and you cannot see it: a private resource you have no access to answers exactly as an absent one does
errorErrorBody
- The ErrorBody schema
- codestringThe coarse category, tied to the status:
NOT_FOUND,CONFLICT,INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all. - messagestringWhat went wrong, for a person. Written to be read, not parsed: match on
reasonorcode. - fieldstring or nulloptionalOn a
400that refused one field's value, the field, as its JSON path:email,items[0].name. Put the message under that input. Absent on every other error. - reasonstring or nulloptionalThe specific code, when the error has one:
LAST_ORGANIZATION_OWNER,BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and oncodeotherwise. - required_scopestring or nulloptionalThe scope the access token was missing, on
INSUFFICIENT_SCOPE. - violationsanyoptionalPresent on the structured-validation errors (
PROVIDER_VALIDATION_FAILEDper-node,PIPELINE_VALIDATION_FAILEDDAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
404 exampleSynthesized example
{
"error": {
"code": "code-c2d2",
"message": "Pin a page's payload to the build that rendered it"
}
}
CLI
gitmoap ai-org get-ai-profile-draft
- --draft-ididThe persona draft