{
  "openapi": "3.0.3",
  "info": {
    "title": "Ravi API",
    "version": "1.0.0",
    "description": "Identity provider for AI agents \u2014 provisioned phone numbers, email addresses, TOTP, OTP extraction, and E2E-encrypted passwords and secrets."
  },
  "paths": {
    "/api/identities/": {
      "get": {
        "operationId": "identities_list",
        "description": "Create, list, retrieve, and update identities for the authenticated user.",
        "tags": [
          "Identities"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Identity"
                  }
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "identities_create",
        "description": "Create, list, retrieve, and update identities for the authenticated user.",
        "tags": [
          "Identities"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityCreateRequest"
              },
              "examples": {
                "CreateIdentity(auto-name)": {
                  "value": {},
                  "summary": "Create identity (auto-name)"
                },
                "CreateIdentityWithName": {
                  "value": {
                    "name": "shopping-agent"
                  },
                  "summary": "Create identity with name"
                },
                "CreateIdentityWithCustomEmail": {
                  "value": {
                    "name": "shopping-agent",
                    "email": "shopping"
                  },
                  "summary": "Create identity with custom email"
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/IdentityCreateRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/IdentityCreateRequest"
              }
            }
          }
        },
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityCreate"
                },
                "examples": {
                  "IdentityCreated": {
                    "value": {
                      "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "name": "Sarah Johnson",
                      "inbox": "sarah.johnson472@example.com",
                      "phone": null,
                      "created_dt": "2025-06-01T12:00:00Z",
                      "updated_dt": "2025-06-01T12:00:00Z"
                    },
                    "summary": "Identity created"
                  }
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/identities/{uuid}/": {
      "get": {
        "operationId": "identities_retrieve",
        "description": "Create, list, retrieve, and update identities for the authenticated user.",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Identities"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            },
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "identities_update",
        "description": "Create, list, retrieve, and update identities for the authenticated user.",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Identities"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/IdentityRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/IdentityRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            },
            "description": ""
          }
        }
      },
      "patch": {
        "operationId": "identities_partial_update",
        "description": "Create, list, retrieve, and update identities for the authenticated user.",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Identities"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedIdentityRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PatchedIdentityRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PatchedIdentityRequest"
              }
            }
          }
        },
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Identity": {
        "type": "object",
        "description": "Serializer for Identity with nested email/phone strings.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "description": "Human-readable label for this identity, unique per user.",
            "maxLength": 100
          },
          "inbox": {
            "type": "string",
            "readOnly": true
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "created_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "created_dt",
          "inbox",
          "name",
          "phone",
          "updated_dt",
          "uuid"
        ]
      },
      "IdentityCreate": {
        "type": "object",
        "description": "Extends IdentitySerializer with an optional custom email for creation.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "default": "",
            "maxLength": 100
          },
          "inbox": {
            "type": "string",
            "readOnly": true
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "created_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "email": {
            "type": "string",
            "default": "",
            "maxLength": 254
          }
        },
        "required": [
          "created_dt",
          "inbox",
          "phone",
          "updated_dt",
          "uuid"
        ]
      },
      "IdentityCreateRequest": {
        "type": "object",
        "description": "Extends IdentitySerializer with an optional custom email for creation.",
        "properties": {
          "name": {
            "type": "string",
            "default": "",
            "maxLength": 100
          },
          "email": {
            "type": "string",
            "default": "",
            "maxLength": 254
          }
        }
      },
      "IdentityRequest": {
        "type": "object",
        "description": "Serializer for Identity with nested email/phone strings.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Human-readable label for this identity, unique per user.",
            "maxLength": 100
          }
        },
        "required": [
          "name"
        ]
      },
      "PatchedIdentityRequest": {
        "type": "object",
        "description": "Serializer for Identity with nested email/phone strings.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Human-readable label for this identity, unique per user.",
            "maxLength": 100
          }
        }
      }
    }
  }
}
