DocsAPI referenceAuthentication

Authentication

Sign up, sign in and refresh tokens.

Credentials

Credentials stay in this browser tab (sessionStorage) and are sent only to https://api.indexone.io. They are cleared when the tab closes.

Cognito-backed sign-up, sign-in, token refresh and password reset. Signing up and signing in need no credentials; refreshing a token and resetting a password need the API key.

Start a password reset

POST
/forgot_password

Emails a password-reset confirmation code. Complete the reset with POST /forgot_password/confirm.

x-api-key

Request body

FieldTypeDescription
usernamerequiredstring
curl -X POST "https://api.indexone.io/forgot_password" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "quant@example.com"
}'

Try it

Request body
Loading...
https://api.indexone.io/forgot_password

Example response

{
"CodeDeliveryDetails": {
"Destination": "q***@e***.com",
"DeliveryMedium": "EMAIL",
"AttributeName": "email"
}
}

Errors

FieldTypeDescription
400Error
Unknown user, or Cognito rate-limited the reset. The Cognito exception is uncaught, so the body is a generic gateway error.
401Error
The API key is missing or invalid (invalid_api_key).
429object
API key usage-plan rate limit exceeded.

Complete a password reset

POST
/forgot_password/confirm

Sets a new password using the code emailed by POST /forgot_password.

x-api-key

Request body

FieldTypeDescription
usernamerequiredstring
passwordrequiredstring
The new password.
confirmation_coderequiredstring
curl -X POST "https://api.indexone.io/forgot_password/confirm" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "quant@example.com",
"password": "N3w-Passw0rd!",
"confirmation_code": "482913"
}'

Try it

Request body
Loading...
https://api.indexone.io/forgot_password/confirm

Example response

{}

Errors

FieldTypeDescription
400Error
Wrong or expired code, or the new password violates the Cognito policy.
401Error
The API key is missing or invalid (invalid_api_key).
429object
API key usage-plan rate limit exceeded.

Exchange a refresh token for a new id token

POST
/refresh_token

Returns a fresh id token from the refresh token issued by POST /signin. No new refresh token is issued — keep using the original. An expired, revoked or malformed refresh token returns 401 with {"error": …} — treat it as a sign-out and re-authenticate.

x-api-key

Request body

FieldTypeDescription
refresh_tokenrequiredstring
curl -X POST "https://api.indexone.io/refresh_token" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.refresh"
}'

Try it

Request body
Loading...
https://api.indexone.io/refresh_token

Example response

{
"id_token": "eyJraWQiOiJ4WGZQK0k9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI3ZGNkMjIxZS00Y2Y0LTRjYjUtODQ1ZS0zMmVmYzE4MDNlZTYifQ.sig",
"expires_in": 3600,
"status": "success"
}

Errors

FieldTypeDescription
401Error
The refresh token is expired, revoked or invalid — re-authenticate with POST /signin. Also when the API key is missing or invalid (invalid_api_key).
429object
API key usage-plan rate limit exceeded.

Sign in and get tokens

POST
/signin

Authenticates against Cognito using the USER_PASSWORD_AUTH flow and returns an id token, a refresh token and primary_team, the team the account acts as. Needs no credentials. Send id_token as the Authorization header on every authenticated request — raw, with no Bearer prefix. It expires after expires_in seconds (3600 by default); use POST /refresh_token to get a new one without re-prompting for the password.

No authentication

Request body

FieldTypeDescription
usernamerequiredstring
Lower-cased server-side, so case does not matter.
passwordrequiredstring
curl -X POST "https://api.indexone.io/signin" \
-H "Content-Type: application/json" \
-d '{
"username": "quant@example.com",
"password": "S3cure-Passw0rd!"
}'

Try it

Request body
Loading...
https://api.indexone.io/signin

Example response

{
"id_token": "eyJraWQiOiJ4WGZQK0k9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI3ZGNkMjIxZS00Y2Y0LTRjYjUtODQ1ZS0zMmVmYzE4MDNlZTYiLCJlbWFpbCI6InF1YW50QGV4YW1wbGUuY29tIiwiZXhwIjoxNzg0NTUyMDAwfQ.sig",
"refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.refresh",
"expires_in": 3600,
"primary_team": "33a36e74-b36a-4a50-9a99-edeff5144a43"
}

Errors

FieldTypeDescription
400Error
username or password is missing.
401Error
Wrong password, too many failed attempts, or no such account. code is the Cognito exception (NotAuthorizedException, UserNotFoundException).
403Error
The account was never confirmed: resend the code with POST /signup/resend and confirm it.
429Error
The sign-in service is throttling (TooManyRequestsException, LimitExceededException). Wait and retry.
502Error
The sign-in service failed. Retry.

Create a user account

POST
/signup

Creates an account, unconfirmed, and emails a six-digit confirmation code to the address: call POST /signup/confirm with it next. Needs no credentials, so a script or an agent can sign up without the console; a person still has to read the code. The account cannot sign in, and has no team, until it is confirmed. Confirming joins the team that invited the address, or makes a new team with the account as its admin. The optional profile fields (firstname, lastname, company, position, industry, use_case, country, company_type, heard_about) are kept on the account. Without a captcha_token, a sign-up counts against its IP address's limit of 5 an hour. Disposable-email domains are refused. The same route doubles as the marketing contact form: {"hubspot_only": true, ...} records a contact and makes no account.

No authentication

Request body

FieldTypeDescription
usernamerequiredstring
Email address. Lower-cased server-side.
passwordrequiredstring
At least 8 characters, with an upper-case letter, a lower-case letter, a number and a symbol, and no space at either end.
firstnamestring
lastnamestring
companystring
positionstring
industrystring
use_casestring
countrystring
company_typestring
heard_aboutstring
captcha_tokenstring
A reCAPTCHA token (the console's form sends one). Without it, the per-IP limit applies.
hubspot_onlyboolean
Create only a CRM contact, no user account.
curl -X POST "https://api.indexone.io/signup" \
-H "Content-Type: application/json" \
-d '{
"username": "quant@example.com",
"password": "S3cure-Passw0rd!",
"firstname": "Ada",
"lastname": "Lovelace",
"company": "Example Capital"
}'

Try it

Request body
Loading...
https://api.indexone.io/signup

Example response

"7dcd221e-4cf4-4cb5-845e-32efc1803ee6"

Errors

FieldTypeDescription
400Error
username or password is missing, the body is not JSON, or the request looks automated (invalid_request); or Cognito refused a field (InvalidParameterException).
409Error
The address has a confirmed account: sign in, or reset the password with POST /forgot_password.
422Error
The password breaks the rules (InvalidPasswordException), or the address is at a disposable-email domain (UserLambdaValidationException).
429Error
Too many sign-ups from this IP address this hour (rate_limited), or the sign-in service is throttling (TooManyRequestsException, LimitExceededException). Wait and retry.
502Error
The sign-in service failed. Retry.

Confirm a new account

POST
/signup/confirm

Confirms the address with the code POST /signup emailed, and sets the account up: it joins the team that invited the address (as an admin if the invite says so), or a new team is made with the account as its admin. After this the account can sign in. Confirming an account that is already confirmed also succeeds. Needs no credentials.

No authentication

Request body

FieldTypeDescription
usernamerequiredstring
confirmation_coderequiredstring
curl -X POST "https://api.indexone.io/signup/confirm" \
-H "Content-Type: application/json" \
-d '{
"username": "quant@example.com",
"confirmation_code": "482913"
}'

Try it

Request body
Loading...
https://api.indexone.io/signup/confirm

Example response

"success"

Errors

FieldTypeDescription
400Error
username or confirmation_code is missing.
404Error
No account has that address.
422Error
The code is wrong (CodeMismatchException), expired (ExpiredCodeException, after 24 hours: get a new one with POST /signup/resend) or was not accepted (NotAuthorizedException).
429Error
Too many wrong codes (TooManyFailedAttemptsException, LimitExceededException). Wait and retry.
500Error
The address is confirmed, but setting up its team failed. Contact support@indexone.io.

Resend the confirmation code

POST
/signup/resend

Emails a new confirmation code for an account that POST /signup created and nobody has confirmed yet. Needs no credentials.

No authentication

Request body

FieldTypeDescription
usernamerequiredstring
curl -X POST "https://api.indexone.io/signup/resend" \
-H "Content-Type: application/json" \
-d '{
"username": "ada@example.com"
}'

Try it

Request body
Loading...
https://api.indexone.io/signup/resend

Example response

{
"status": "sent"
}

Errors

FieldTypeDescription
400Error
username is missing, or the account is already confirmed (InvalidParameterException).
404Error
No account has that address.
429Error
Too many codes requested.
502Error
The sign-in service failed. Retry.