> ## Documentation Index
> Fetch the complete documentation index at: https://readme.amana-dev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign up with a social provider

> Register or sign in a user with a token from a supported social provider and get an access token.

## Body

Content type: `application/json`

<ParamField body="token" type="string" required />

<ParamField body="provider" type="enum<string>" required>
  Available options: `google`, `apple`
</ParamField>

<ParamField body="hint" type="string" />

<ParamField body="params" type="object" />

<ParamField body="name" type="object">
  <Expandable title="properties">
    <ParamField body="fname" type="string" required>
      Minimum length: `1`
    </ParamField>

    <ParamField body="lname" type="string" required>
      Minimum length: `1`
    </ParamField>
  </Expandable>
</ParamField>

## Response

`200` Success.

<ResponseField name="sid" type="string" />

<ResponseField name="nextStep" type="enum<string>">
  Available options: `name`, `country`
</ResponseField>

## Possible Errors

| Error | Possible cause | What to do |
| - | - | - |
| 400 | Invalid or missing field | Check the request against the schema. |
| 401 | Token missing or expired | Log in again or use the refresh token. |
| 403 | IP not whitelisted, or account restricted | Confirm your IP is whitelisted; otherwise contact Amana. |
| 404 | The requested item doesn't exist | Check the ID or path parameter. |
| 429 / 5xx | Rate limit, or temporary issue on our side | Retry with backoff; contact support if it persists. |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://gateway.amana.io/auth/social-signup' \
    --header 'Content-Type: application/json' \
    --data '{
    "token": "<string>",
    "provider": "google",
    "hint": "<string>",
    "params": {},
    "name": {
      "fname": "<string>",
      "lname": "<string>"
    }
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://gateway.amana.io/auth/social-signup"
  headers = {"Content-Type": "application/json"}
  payload = {
      "token": "<string>",
      "provider": "google",
      "hint": "<string>",
      "params": {},
      "name": {
          "fname": "<string>",
          "lname": "<string>"
      }
  }

  response = requests.request("POST", url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://gateway.amana.io/auth/social-signup', {
    method: 'POST',
    headers: {"Content-Type": "application/json"},
    body: JSON.stringify({"token": "<string>", "provider": "google", "hint": "<string>", "params": {}, "name": {"fname": "<string>", "lname": "<string>"}}),
  });
  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "sid": "<string>",
    "nextStep": "name"
  }
  ```

  ```json 400 theme={null}
  {
    "error": "<string>",
    "message": "<string>",
    "details": {}
  }
  ```

  ```json 401 theme={null}
  {
    "error": "<string>",
    "message": "<string>",
    "details": {}
  }
  ```

  ```json 403 theme={null}
  {
    "error": "<string>",
    "message": "<string>"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "<string>",
    "message": "<string>",
    "details": {}
  }
  ```

  ```json 429 theme={null}
  {
    "error": "<string>",
    "message": "<string>"
  }
  ```

  ```json 500 theme={null}
  {
    "error": "<string>",
    "message": "<string>"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.