Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Authentication

All API requests must be authenticated. First, call the login endpoint to receive an access token. Then send that token in the Authorization header of every subsequent request.

You can authenticate in one of two ways:

Method
Recommended for

Client ID + Client Secret

Integrations, servers and automated systems

Email + Password

Testing and manual use

This page focuses on the Client ID + Client Secret flow.


Step 1: Get your Client ID and Client Secret

  1. Log in to the 2Sign system.

  2. Go to Settings > API.

  3. Copy the Client ID.

  4. Click Generate next to Client Secret.

  5. Copy the Client Secret and store it securely, then click Save.

The Client Secret is a GUID in this format:

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

No additional activation is required on the account.


Step 2: Request an access token

Send a POST request to /api/Account/LoginApi.

Option A: Client ID and Client Secret

Field
Description

GrantType

Must be "client"

ClientId

The Client ID from Settings > API

ClientSecret

The Client Secret you generated in Settings > API

Option B: Email and password

Example request

Example response


Step 3: Use the access token

Extract the value of the access_token field and send it in the Authorization header of every request:


Security best practices

  • Treat the Client Secret like a password.

  • Store it in a secure place (environment variable or secrets manager).

  • Never expose it in public repositories, client-side code, or logs.

  • Never send it in support emails, tickets or screenshots. Always mask it.

Keep your Client Secret private. Do not share it or commit it to source control. Store it in your application's secure configuration.


Troubleshooting

Problem
What to check

400 Bad Request

Make sure the body is valid JSON (no trailing commas) and that GrantType is "client".

Authentication fails with a valid-looking secret

The Client Secret may have been copied after saving. Generate a new one and copy it before clicking Save.

Lost the Client Secret

It cannot be retrieved. Generate a new one in Settings > API.

Unsure which value goes where

ClientId ← Client ID, ClientSecret ← Client Secret, both from Settings > API.

Error: token wasnt created

Check the following:

  1. The Client Secret was generated successfully in API Settings.

  2. You copied the value before clicking Save (a Client Secret copied after saving will not work).

  3. The Client ID and Client Secret belong to the same account/pair.

  4. You are sending the request to POST /api/Account/LoginApi.

  5. You are using the Client Secret and not the API Key.

  6. The body does not contain extra fields such as Url, Guid or Code.

If the error persists, contact 2Sign support and include:

  • The endpoint and HTTP method

  • The request body (with the Client Secret masked)

  • The full error response

  • Any request / correlation ID, if available


LoginApi

post
Body
EmailstringOptionalExample: client@example.com
PasswordstringOptionalExample: sample_password
RememberMebooleanRequiredExample: true
GrantTypestringOptionalExample: sample_granttype
ClientIdstringOptionalExample: id_3241c482
ClientSecretstringOptionalExample: sample_clientsecret
CodestringOptionalExample: sample_code
PhoneNumberstringOptionalExample: sample_phonenumber
UrlstringOptionalExample: sample_url
GuidstringOptionalExample: id_2019b980
OTPResendAttemptsintegerOptionalExample: 1
Is2faModebooleanOptionalExample: true
AuthenticatorsstringOptional
EmailmpstringOptionalExample: client@example.com
UserIdOuterEncstringOptionalExample: id_07cc8271
Responses
200

Success (Custom Example)

application/json
stringOptionalExample: { "Status":"success", "Message":"", "ResponseObject":{ "Email":"apisimulator@2sign.co.il", "Password":null, "HasRegistered":null, "LoginProvider":null, "UserName":"apisimulator@2sign.co.il", "access_token":"Ky0L1ABLsZv8JuZEUCND9qOC7qtAmX5BQPp1t2ljTuES5-O5FjZoSSxkzmGAXa7hdFbhwOv4tRDdEBuKQ2lWAoOjhAfYmmy1w_HoL3QSlTYCjq01zembSNdEUexnjYwLHfZXCagEXIGP85_QoGOwyTRrexXOS8MBU5kSFWZdrQF5512b721weX2BU55EEaIp46f5W4U1ucA-7ogVYKt9En9W5iMVWcSr3JxF46G2BYtPW8AjflUgxuO2k5PBpjBuIa0vnkptCkyKVfcm1Xh3usr-q8RhKUUo3db4x1bQQjeE9OSLK9DQ-p715fcWbFjakGFqdrhYVhHHpJWp45dadTcg5EYDH-XL96VdO203UCyCC0w3MvJzF3YMZ3cx5J4qpZ1ogm3KRvj85l4C563iEkOBRZgvFRozZwuyGK-fpZk4z0Lt-4LlReENW9qCLnYOUC-EAEy_zANW3Rzc71QTF--Twisv0fJme_1sQOiKChKjr9Vv5j-7B5-og", "Address":null, "LanguageId":null, "CompanyName":null } }
post/api/Account/LoginApi
POST /api/Account/LoginApi HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 389

{
  "Email": "client@example.com",
  "Password": "sample_password",
  "RememberMe": true,
  "GrantType": "sample_granttype",
  "ClientId": "id_3241c482",
  "ClientSecret": "sample_clientsecret",
  "Code": "sample_code",
  "PhoneNumber": "sample_phonenumber",
  "Url": "sample_url",
  "Guid": "id_2019b980",
  "OTPResendAttempts": 1,
  "Is2faMode": true,
  "Authenticators": null,
  "Emailmp": "client@example.com",
  "UserIdOuterEnc": "id_07cc8271"
}
{

   "Status":"success",

   "Message":"",

   "ResponseObject":{

      "Email":"apisimulator@2sign.co.il",

      "Password":null,

      "HasRegistered":null,

      "LoginProvider":null,

      "UserName":"apisimulator@2sign.co.il",

      "access_token":"Ky0L1ABLsZv8JuZEUCND9qOC7qtAmX5BQPp1t2ljTuES5-O5FjZoSSxkzmGAXa7hdFbhwOv4tRDdEBuKQ2lWAoOjhAfYmmy1w_HoL3QSlTYCjq01zembSNdEUexnjYwLHfZXCagEXIGP85_QoGOwyTRrexXOS8MBU5kSFWZdrQF5512b721weX2BU55EEaIp46f5W4U1ucA-7ogVYKt9En9W5iMVWcSr3JxF46G2BYtPW8AjflUgxuO2k5PBpjBuIa0vnkptCkyKVfcm1Xh3usr-q8RhKUUo3db4x1bQQjeE9OSLK9DQ-p715fcWbFjakGFqdrhYVhHHpJWp45dadTcg5EYDH-XL96VdO203UCyCC0w3MvJzF3YMZ3cx5J4qpZ1ogm3KRvj85l4C563iEkOBRZgvFRozZwuyGK-fpZk4z0Lt-4LlReENW9qCLnYOUC-EAEy_zANW3Rzc71QTF--Twisv0fJme_1sQOiKChKjr9Vv5j-7B5-og",

      "Address":null,

      "LanguageId":null,

      "CompanyName":null

   }

}

Last updated