bitcain docs
API Reference

Auth

Authentication and authorization endpoints (OAuth2, JWT, MFA)

Signup

POST
/auth/signup

Request Body

application/json

email*string

User email address

Formatemail
password*string

User password (min 8 characters)

Length8 <= length

Response Body

application/json

application/json

curl -X POST "https://loading/auth/signup" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "password": "stringst"  }'
{
  "success": true,
  "user": {
    "id": "string",
    "email": "string",
    "email_confirmed_at": "2019-08-24T14:15:22Z"
  },
  "session": {
    "access_token": "string",
    "refresh_token": "string",
    "expires_at": 0
  },
  "error": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Login

POST
/auth/login

Request Body

application/json

email*string

User email address

Formatemail
password*string

User password

Response Body

application/json

application/json

curl -X POST "https://loading/auth/login" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "password": "string"  }'
{
  "success": true,
  "user": {
    "id": "string",
    "email": "string",
    "email_confirmed_at": "2019-08-24T14:15:22Z"
  },
  "session": {
    "access_token": "string",
    "refresh_token": "string",
    "expires_at": 0
  },
  "error": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Refresh Token

POST
/auth/refresh

Request Body

application/json

refresh_token*string

Refresh token from previous session

Response Body

application/json

application/json

curl -X POST "https://loading/auth/refresh" \  -H "Content-Type: application/json" \  -d '{    "refresh_token": "string"  }'
{
  "success": true,
  "user": {
    "id": "string",
    "email": "string",
    "email_confirmed_at": "2019-08-24T14:15:22Z"
  },
  "session": {
    "access_token": "string",
    "refresh_token": "string",
    "expires_at": 0
  },
  "error": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Logout

POST
/auth/logout

Request Body

application/json

access_token*string

Access token to invalidate

Response Body

application/json

application/json

curl -X POST "https://loading/auth/logout" \  -H "Content-Type: application/json" \  -d '{    "access_token": "string"  }'
{
  "property1": "string",
  "property2": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Resend Verification

POST
/auth/resend-verification

Request Body

application/json

email*string

Email address to resend verification to

Formatemail

Response Body

application/json

application/json

curl -X POST "https://loading/auth/resend-verification" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com"  }'
{
  "success": true,
  "message": "string",
  "retry_after": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Profile

GET
/auth/profile

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/auth/profile"
{
  "id": "string",
  "email": "string",
  "full_name": "string",
  "avatar_url": "string",
  "phone": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Verify Email

POST
/auth/verify-email

Request Body

application/json

token*string

Verification token from email link

Response Body

application/json

application/json

curl -X POST "https://loading/auth/verify-email" \  -H "Content-Type: application/json" \  -d '{    "token": "string"  }'
{
  "success": true,
  "message": "string",
  "redirect_url": "string",
  "resend_url": "string",
  "user_id": "string",
  "email": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Verification Status

GET
/auth/verification-status

Query Parameters

email*string

Response Body

application/json

application/json

curl -X GET "https://loading/auth/verification-status?email=string"
{
  "email": "string",
  "is_verified": true,
  "status": "string",
  "verified_at": "2019-08-24T14:15:22Z",
  "token_expires_at": "2019-08-24T14:15:22Z",
  "time_remaining_seconds": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

List Api Keys

GET
/api/v1/api-keys/

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://loading/api/v1/api-keys/"
{}

Create Api Key

POST
/api/v1/api-keys/

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "https://loading/api/v1/api-keys/"
{
  "success": true,
  "message": "string",
  "data": {}
}

Decrypt Api Key

POST
/api/v1/api-keys/{key_id}/decrypt

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/api-keys/string/decrypt"
{
  "success": true,
  "message": "string",
  "data": {
    "api_key": "...",
    "secret": "..."
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Api Key

PATCH
/api/v1/api-keys/{key_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/v1/api-keys/string"
{
  "success": true,
  "message": "string",
  "data": {}
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Delete Api Key

DELETE
/api/v1/api-keys/{key_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/v1/api-keys/string"
{
  "success": true,
  "message": "string",
  "data": {}
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Test Api Key Connection

POST
/api/v1/api-keys/{key_id}/test-connection

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

key_id*string

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/api-keys/string/test-connection"
{
  "success": true,
  "message": "string",
  "data": {}
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Health Check

GET
/api/kyc/health

Response Body

application/json

curl -X GET "https://loading/api/kyc/health"
{}

Kyc Webhook

POST
/api/kyc/webhook

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "https://loading/api/kyc/webhook"
null

Root

GET
/api/kyc/

Response Body

application/json

curl -X GET "https://loading/api/kyc/"
{}