Series API

 1.0.0 
OAS 3.1
/openapi.json

API for Series application

authentication

Send a verification code to the provided phone number.

Args: request: Phone verification request

Returns: Dict: Response with success status and message

Parameters

No parameters

Request body

                                        {
  "phone": "string"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "additionalProp1": {}
}
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Verify Phone Code

Verify a code for a phone number and return an authentication token.

Args: request: Verification code request

Returns: TokenResponse: Authentication token response

Parameters

No parameters

Request body

                                        {
  "phone": "string",
  "code": "string"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "token": "string",
  "user_id": "string",
  "expires_in": 0
}
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Logout

Revoke an authentication token.

Args: token: Authentication token to revoke

Returns: Dict: Response with success status

Parameters

No parameters

Request body

                                        {
  "token": "string"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Validate Token

Validate an authentication token.

Args: token: Authentication token to validate (from Authorization header)

Returns: Dict: Response with validation status and user ID if valid

Parameters

Name Description
x *
any
(query)

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

users

REDACTED
Check Phone Exists

Check if a phone number already exists in the database.

Args: phone: Phone number to check (E.164 format expected)

Returns: Dict[str, bool]: Object with 'exists' boolean indicating if phone is registered

Raises: HTTPException: If there's an error checking the phone number

Parameters

Name Description
phone *
string
(query)

Phone number to check

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "additionalProp1": true,
  "additionalProp2": true,
  "additionalProp3": true
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Check Email Exists

Check if an email address already exists in the database.

Args: email: Email address to check

Returns: Dict with 'exists' boolean, 'userId' if found, and 'hasCompleteProfile' boolean

Raises: HTTPException: If there's an error checking the email address

Parameters

Name Description
email *
string
(query)

Email address to check

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "additionalProp1": true,
  "additionalProp2": true,
  "additionalProp3": true
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Create New User

Create a new user in the system.

Args: user_data: User data including name, phone, bio, etc.

Returns: User: The created user data

Raises: HTTPException: If user creation fails or validation fails

Parameters

No parameters

Request body

                                        {
  "phone": "string",
  "email": "string",
  "name": {
    "first": "string",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "metadata": {
    "archetype": false,
    "referredBy": "string",
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.178Z",
      "error": "string"
    }
  }
}

Responses

Code Description
201

Successful Response

Media type
Controls Accept header.
                                              {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 1600,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.179Z",
    "last_updated_ts": "2025-07-12T07:30:45.179Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.179Z",
      "error": "string"
    }
  },
  "sender": "string"
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Augment User

Augment user data with LinkedIn information and create archetype users from network.

  1. Search and scrape LinkedIn for the user, store in metadata
  2. For each network contact:
    • Search and scrape LinkedIn
    • Generate archetype using LLM (name, bio, probability)
    • Create new user from archetype
    • Create match between original user and new archetype user

Parameters

Name Description
user_id *
string
(path)

The ID of the user to augment

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 1600,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.182Z",
    "last_updated_ts": "2025-07-12T07:30:45.182Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.182Z",
      "error": "string"
    }
  },
  "sender": "string"
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get Public User Profile

Retrieve a user's public profile information (no authentication required).

This endpoint returns only public-safe information suitable for profile viewing.

Args: user_id: The unique ID of the user to retrieve

Returns: Dict containing public user profile data

Raises: HTTPException: If user is not found

Parameters

Name Description
user_id *
string
(path)

The unique ID of the user

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "additionalProp1": {}
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get User By Id

Retrieve a user by their ID.

Args: user_id: The unique ID of the user to retrieve current_user: The currently authenticated user (from JWT token)

Returns: User: The requested user's data

Raises: HTTPException: If user is not found or not authorized

Parameters

Name Description
user_id *
string
(path)

The unique ID of the user

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 1600,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.185Z",
    "last_updated_ts": "2025-07-12T07:30:45.185Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.185Z",
      "error": "string"
    }
  },
  "sender": "string"
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Update User By Id

Update a user's data.

Args: user_id: The ID of the user to update user_data: The user data to update current_user: The currently authenticated user (from JWT token)

Returns: User: The updated user data

Raises: HTTPException: If user is not found, not authorized, or update fails

Parameters

Name Description
user_id *
string
(path)

The ID of the user to update

Request body

                                        {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "string",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 0,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.188Z",
    "last_updated_ts": "2025-07-12T07:30:45.188Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.188Z",
      "error": "string"
    }
  },
  "sender": "string"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 1600,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.189Z",
    "last_updated_ts": "2025-07-12T07:30:45.189Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.189Z",
      "error": "string"
    }
  },
  "sender": "string"
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get User By Phone Number

Retrieve a user by their phone number.

Args: phone_number: The phone number to look up (E.164 format) current_user: The currently authenticated user (from JWT token)

Returns: User: The requested user's data

Raises: HTTPException: If user is not found or not authorized

Parameters

Name Description
phone_number *
string
(path)

The phone number to look up (E.164 format)

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "userId": "string",
  "phone": "string",
  "email": "string",
  "name": {
    "first": "",
    "last": "User"
  },
  "bio": "string",
  "age": 0,
  "location": "string",
  "profilePic": "string",
  "color": "string",
  "elo": 1600,
  "metadata": {
    "created_ts": "2025-07-12T07:30:45.191Z",
    "last_updated_ts": "2025-07-12T07:30:45.191Z",
    "notes": {
      "aiScore": 10,
      "userScore": 10,
      "text": "",
      "flagged": false
    },
    "archetype": false,
    "referredBy": "string",
    "linkedin_info": {
      "url": "string",
      "content": {
        "additionalProp1": {}
      }
    },
    "network": [
      {
        "name": "string",
        "email": "string",
        "timeSpent": 0
      }
    ],
    "picture_data": {
      "face_detected": false,
      "gender": {
        "label": "string",
        "confidence": 0
      },
      "race": {
        "label": "string",
        "confidence": 0
      },
      "analyzed_at": "2025-07-12T07:30:45.191Z",
      "error": "string"
    }
  },
  "sender": "string"
}
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Close Loop

Parameters

Name Description
ref_phone *
string
(query)
ref_email *
string
(query)
sourceId *
string
(query)
targetId *
string
(query)

Request body

                                        {
  "additionalProp1": "string",
  "additionalProp2": "string",
  "additionalProp3": "string"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Analyze Face Endpoint

Analyze a profile photo for face detection and metadata extraction. This endpoint is designed to be called after photo upload for background processing.

Args: user_id: User ID to update metadata for image_url: URL of the uploaded image to analyze bypass_auth: If 'true', bypasses authentication for profile creation current_user: Authenticated user (optional)

Returns: Dict with analysis results

Parameters

Name Description
user_id *
string
(query)
image_url *
string
(query)

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
401

Unauthorized

403

Forbidden

404

Not found

422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Upload Photo

Upload a profile photo to Google Cloud Storage with optional DeepFace analysis.

Args: background_tasks: FastAPI background tasks file: The uploaded file user_id: User ID (optional, not required for profile creation) bypass_auth: If 'true', bypasses authentication for profile creation

Returns: Dict with success status, image URL, and face analysis results

Parameters

No parameters

Request body

file *
string($binary)
user_id
string
bypass_auth
string

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Update Profile Picture

Update a user's profile picture with a processed image URL and perform face analysis. Uses GCS for storage with service account authentication for permanent access.

Parameters

No parameters

Request body

user_id *
string
image_url *
string

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

agent

REDACTED
Process Webhook

Process a webhook from LoopMessage. Only processes direct messages (DMs); group messages are ignored. If an attachment is present, passes the URL to the appropriate agent. Auto-registers users if their phone number is not found in the system. Implements cancellation pattern to handle double-texting.

Parameters

Name Description
bump
boolean
(query)

Default value : false

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

storage

REDACTED
Get Signed Url

Generate a signed URL for uploading a file to Google Cloud Storage.

Args: request: Request containing file name, content type, and bucket name

Returns: SignedUrlResponse: Object containing signed URL and public URL

Parameters

No parameters

Request body

                                        {
  "fileName": "string",
  "contentType": "string",
  "bucketName": "series-v1-profiles"
}

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              {
  "signedUrl": "string",
  "publicUrl": "string"
}
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get Authenticated Url

Generate an authenticated URL for accessing a file in Google Cloud Storage.

Args: bucket_name: Name of the GCS bucket blob_name: Name of the blob in GCS

Returns: Dict: Object containing authenticated URL

Parameters

Name Description
bucket_name *
string
(path)

Name of the GCS bucket

blob_name *
string
(path)

Name of the blob in GCS

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get Permanent Url

Get a permanent access URL for a file in Google Cloud Storage. This URL requires proper authentication to access.

Args: bucket_name: Name of the GCS bucket blob_name: Name of the blob in GCS

Returns: Dict: Object containing permanent URL

Parameters

Name Description
bucket_name *
string
(path)

Name of the GCS bucket

blob_name *
string
(path)

Name of the blob in GCS

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Upload Photo

Upload a profile photo to Google Cloud Storage with optional DeepFace analysis.

Args: background_tasks: FastAPI background tasks file: The uploaded file user_id: User ID (optional, not required for profile creation) bypass_auth: If 'true', bypasses authentication for profile creation

Returns: Dict with success status, image URL, and face analysis results

Parameters

No parameters

Request body

file *
string($binary)
user_id
string
bypass_auth
string

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Update Profile Picture

Update a user's profile picture with a processed image URL and perform face analysis. Uses GCS for storage with service account authentication for permanent access.

Parameters

No parameters

Request body

user_id *
string
image_url *
string

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
REDACTED
Get Profile Image

Proxy endpoint to serve profile images from Google Cloud Storage. This endpoint fetches the image using the backend's service account credentials and serves it to the frontend.

Args: bucket_name: Name of the GCS bucket blob_name: Name of the blob (file) in GCS

Returns: StreamingResponse: Image data with appropriate content type

Parameters

Name Description
bucket_name *
string
(path)
blob_name *
string
(path)

Responses

Code Description
200

Successful Response

Media type
Controls Accept header.
                                              "string"
422

Validation Error

Media type
                                              {
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

default

REDACTED
Serve Local Upload
/
Root
REDACTED
Health Check
REDACTED
Debug Info

object
object
object
object
  • label
    string
  • confidence
    number
object
object
object
  • created_ts
    stringdate-time
  • last_updated_ts
    stringdate-time
  • any
  • boolean
    Defaultfalse
  • (string | null)
  • (any | null)
    (any | null)
    • any
    • #1
      null
  • array<any>
    any
    $ref#/components/schemas/WarmConnect
  • (any | null)
object
  • integer
    Default10
  • integer
    Default10
  • string
    Default""
  • boolean
    Defaultfalse
object
object

Model for phone verification request.

  • string

    Phone number to verify

object
  • boolean
    Defaultfalse
  • (object | null)
    (object | null)
    • object
      • label
        string
      • confidence
        number
    • #1
      null
  • (object | null)
    (object | null)
    • object
      • label
        string
      • confidence
        number
    • #1
      null
  • analyzed_at
    stringdate-time
  • (string | null)
    (string | null)
object
  • label
    string
  • confidence
    number
object
object
object
object
object
object
object
object
object
  • name
    string
  • email
    string
  • timeSpent
    number
object
  • boolean
    Defaultfalse
  • (string | null)
  • array<any>
    any
    $ref#/components/schemas/WarmConnect
  • (any | null)
object
  • created_ts
    stringdate-time
  • last_updated_ts
    stringdate-time
  • object
  • boolean
    Defaultfalse
  • (string | null)
  • (object | null)
    (object | null)
    • object
      • (string | null)
        (string | null)
        • #0
          string
        • #1
          null
      • (object | null)
        (object | null)
    • #1
      null
  • array<object>
    object
    • name
      string
    • email
      string
    • timeSpent
      number
  • (object | null)