---
title: "Social Auth"
method: POST
path: "/api/v1/auth/social/{provider}"
tags: ["Authentication"]
---

# Social Auth

`POST /api/v1/auth/social/{provider}`

## Request

- Base URL: `https://www.endlesstravelplans.com`
- URL: `https://www.endlesstravelplans.com/api/v1/auth/social/{provider}`
- Auth: none required

Exchange a social provider token for an API token. Supports Google, Apple, and Facebook.

## Request body

- object
  - `token` string, required: The access token (Google/Facebook) or identity token (Apple).
  - `authorization_code` string: optional Apple authorization code from the native sign-in; lets the server revoke the sign-in when the account is deleted.
  - `partner_code` string, nullable: Must not be greater than 32 characters.

## Response `200`

- union
  - object: Existing account
    - `user` object
      - `id` integer
      - `first_name` string
      - `last_name` string
      - `email` string
      - `phone` string, nullable
      - `bio` string, nullable
      - `preferred_language` string, nullable
      - `timezone` string
      - `profile_photo_url` string, nullable
      - `has_pro_access` boolean
      - `subscription_plan` string
      - `can_create_trip` boolean
      - `max_saved_trips` integer
      - `is_anonymous` boolean
      - `marketing_consent` boolean
      - `marketing_consent_source` string
      - `created_at` string
    - `token` string
    - `expires_in` integer
    - `expires_at` string
  - object: Two factor challenge
    - `requires_2fa` boolean
    - `two_factor_token` string

## Other responses

- `201`
- `401`
- `422`
- `429`: rate_limited: A throttle or a per-account allowance refused the request; `retry_after` or `remaining` may be present.
- `500`: server_error: Unhandled failure; quote `request_id` to support.

---

[API](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api.md) · [All operations](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/llms.txt) · [OpenAPI document](https://skmtc.dev/endlesstravelplans/apis/endless-travel-plans-api/revisions/ae82ed3e4a8f?raw)
