---
title: "Create a link for a sub account to authorize their account"
method: POST
path: "/accounts/authorize"
tags: ["Accounts"]
---

# Create a link for a sub account to authorize their account

`POST /accounts/authorize`

We recommend calling this endpoint first when you onboard your users to cater for those that may already have Ryft accounts.
If the email supplied is not registered with Ryft then you should instead use our account-links API to register a new user.
This API can only be accessed for `Hosted` sub accounts.

## Request body

- object — The request body for creating an auth link
  - `email` string, email — The main email address for the account
  - `redirectUrl` string — The URL to redirect back to once the customer has authenticated (success/fail). We will append the `accountId` under query parameter `account` for the customer onto your redirectUrl once they successfully authenticate. You should check for this parameter once the customer returns and store it for future use.

## Response `200`

Successfully created temporary auth link

- CreateAuthLinkResponse
  - `createdTimestamp` integer — The epoch timestamp (seconds) when the temporary auth link was created
  - `expiresTimestamp` integer — The epoch timestamp (seconds) when the temporary auth link expires
  - `url` string — The URL to redirect to.

## Other responses

- `400` — One or more inputs are invalid
- `404` — No sub accounts were found with this email
- `500` — An unexpected error occurred when executing this request

---

[API](https://skmtc.net/ryftpay/apis/ryft-payment-api.md) · [All operations](https://skmtc.net/ryftpay/apis/ryft-payment-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ryftpay/ryft-payment-api/versions/a042f64d4305/schema)
