{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://astrocollabapi.com/schemas/PairedKey.schema.json",
  "title": "PairedKey",
  "type": "object",
  "required": [
    "key_id",
    "api_key",
    "account_id",
    "client_name",
    "installation_id"
  ],
  "properties": {
    "key_id": {
      "$ref": "Uuid.schema.json"
    },
    "api_key": {
      "type": "string",
      "minLength": 32,
      "maxLength": 512,
      "description": "Send as `Authorization: Bearer <api_key>`. Store it in a credential store."
    },
    "account_id": {
      "$ref": "Uuid.schema.json"
    },
    "client_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "installation_id": {
      "$ref": "Uuid.schema.json"
    },
    "project_ids": {
      "type": "array",
      "items": {
        "$ref": "Uuid.schema.json"
      },
      "minItems": 1,
      "maxItems": 100,
      "description": "Present when the user limited the key to these projects.",
      "uniqueItems": true
    },
    "expires_at": {
      "$ref": "Timestamp.schema.json",
      "description": "Present when the user set an expiry."
    },
    "equipment_id": {
      "$ref": "Uuid.schema.json",
      "description": "Present when the user issued the code for a rig set up on the web pages."
    }
  },
  "description": "A new API key. The secret appears only in this response.",
  "additionalProperties": false
}
