Docs
Sign in
Auth

Start CLI device authorization

Last updated August 23, 2026

post/v1/auth/device/code

Request

Required

Content type application/json

PropertyTypeRequiredDescription
clientIdstringRequired
codeChallengestringRequired
codeChallengeMethodstringRequired
View JSON schema
{
  "type": "object",
  "required": [
    "clientId",
    "codeChallenge",
    "codeChallengeMethod"
  ],
  "properties": {
    "clientId": {
      "type": "string",
      "minLength": 1
    },
    "codeChallenge": {
      "type": "string",
      "minLength": 1
    },
    "codeChallengeMethod": {
      "type": "string",
      "const": "S256"
    }
  }
}

Responses

201

Device authorization request created.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
dataobjectRequired
data.deviceCodestringRequired
data.userCodestringRequired
data.clientobjectRequired
data.client.idstringRequired
data.client.namestringRequired
data.client.publisherstringRequired
data.expiresInintegerRequired
data.intervalintegerRequired
data.verificationUristring (uri)Required
data.verificationUriCompletestring (uri)Required
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "type": "object",
      "required": [
        "deviceCode",
        "userCode",
        "client",
        "expiresIn",
        "interval",
        "verificationUri",
        "verificationUriComplete"
      ],
      "properties": {
        "deviceCode": {
          "type": "string"
        },
        "userCode": {
          "type": "string"
        },
        "client": {
          "type": "object",
          "required": [
            "id",
            "name",
            "publisher"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "publisher": {
              "type": "string"
            }
          }
        },
        "expiresIn": {
          "type": "integer"
        },
        "interval": {
          "type": "integer"
        },
        "verificationUri": {
          "type": "string",
          "format": "uri"
        },
        "verificationUriComplete": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}

400

The request payload or parameters are invalid.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

401

Authentication is missing, invalid, or expired.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

402

The requested operation requires a paid plan. API access (organization API keys) requires the Starter plan or higher; a downgraded organization receives this error until its plan is restored.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

403

The authenticated principal cannot access the resource.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

404

The requested resource was not found.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

413

The request body exceeds the 1 MB limit.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

429

The rate limit was exceeded. API key limits are set by plan tier (Starter 600/min, Pro 1500/min, Enterprise 3000/min). Check the Retry-After header before retrying.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

500

An unexpected internal error occurred.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSTANCE_LIMIT_REACHED" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSTANCE_LIMIT_REACHED",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}