{
  "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/contacts/": {
      "get": {
        "operationId": "contacts_list",
        "parameters": [
          {
            "in": "query",
            "name": "source",
            "schema": {
              "type": "string",
              "x-spec-enum-id": "83674bf0dc9ba8e2",
              "enum": [
                "auto",
                "manual"
              ]
            },
            "description": "* `auto` - Auto\n* `manual` - Manual"
          }
        ],
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            },
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "contacts_create",
        "tags": [
          "Contacts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              },
              "examples": {
                "CreateContact": {
                  "value": {
                    "email": "alice@example.com",
                    "display_name": "Alice Smith",
                    "nickname": "alice"
                  },
                  "summary": "Create contact"
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/contacts/find/": {
      "get": {
        "operationId": "contacts_find_retrieve",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phone_number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/contacts/search/": {
      "get": {
        "operationId": "contacts_search_retrieve",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      }
    },
    "/api/contacts/{uuid}/": {
      "get": {
        "operationId": "contacts_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      },
      "patch": {
        "operationId": "contacts_partial_update",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Contacts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedContactRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PatchedContactRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PatchedContactRequest"
              }
            }
          }
        },
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            },
            "description": ""
          }
        }
      },
      "delete": {
        "operationId": "contacts_destroy",
        "parameters": [
          {
            "in": "path",
            "name": "uuid",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "identityKeyAuth": []
          },
          {
            "managementKeyAuth": []
          },
          {
            "jwtAuth": []
          },
          {
            "cookieAuth": []
          },
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Contact": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "identity": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "phone_number": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "maxLength": 20
          },
          "display_name": {
            "type": "string",
            "maxLength": 255
          },
          "nickname": {
            "type": "string",
            "maxLength": 100
          },
          "is_trusted": {
            "type": "boolean"
          },
          "source": {
            "enum": [
              "auto",
              "manual"
            ],
            "type": "string",
            "description": "* `auto` - Auto\n* `manual` - Manual",
            "x-spec-enum-id": "83674bf0dc9ba8e2",
            "readOnly": true
          },
          "interaction_count": {
            "type": "integer",
            "readOnly": true
          },
          "last_interaction_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "created_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          },
          "updated_dt": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "created_dt",
          "interaction_count",
          "last_interaction_dt",
          "source",
          "updated_dt",
          "uuid"
        ]
      },
      "ContactRequest": {
        "type": "object",
        "properties": {
          "identity": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "phone_number": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "maxLength": 20
          },
          "display_name": {
            "type": "string",
            "maxLength": 255
          },
          "nickname": {
            "type": "string",
            "maxLength": 100
          },
          "is_trusted": {
            "type": "boolean"
          }
        }
      },
      "PatchedContactRequest": {
        "type": "object",
        "properties": {
          "identity": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "phone_number": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{1,14}$",
            "maxLength": 20
          },
          "display_name": {
            "type": "string",
            "maxLength": 255
          },
          "nickname": {
            "type": "string",
            "maxLength": 100
          },
          "is_trusted": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
