Unturned
  • Quick Start
  • References
    • Authentication
    • Health
    • Documents
    • Projects
    • Models
Powered by GitBook

© 2025 Unturned

On this page
  1. References

Authentication

PreviousReferencesNextHealth

Get current user info and billing

get
Authorizations
Responses
200
Successful Response
application/json
get
GET /auth/users/me HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful Response

{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "email": "[email protected]",
    "full_name": "text",
    "is_active": true,
    "is_superuser": true,
    "is_verified": true,
    "projects": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text"
      }
    ],
    "created_at": "text",
    "updated_at": "text",
    "billing": {
      "token_balance": 1,
      "tokens_used": 1,
      "subscription_tier": "text"
    }
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Deactivate an API key

delete
Authorizations
Path parameters
key_idstring · uuidRequiredExample: 63f188cc-77d4-493a-9ce2-164471d9ac29
Header parameters
x-project-idstringRequired

Project ID to operate on

Example: 1a42c90f-02a6-434b-b9e6-43801a9314d0
Responses
200
Successful Response
application/json
422
Validation Error
application/json
delete
DELETE /auth/api-keys/{key_id} HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
x-project-id: text
Accept: */*
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "is_active": true,
    "deactivated_at": "2025-05-13T06:09:30.595Z"
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
  • POSTRequest email verification code (passwordless login)
  • POSTVerify code and get JWT token
  • POSTRefresh JWT token
  • POSTRevoke JWT token
  • GETGet current user info and billing
  • GETList all API keys for the authenticated user
  • POSTCreate a new API key
  • DELETEDeactivate an API key

Request email verification code (passwordless login)

post
Authorizations
Body
emailstring · emailRequired

User email address

Responses
202
Successful Response
application/json
422
Validation Error
application/json
post
POST /auth/verification/send-code HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 44

{
  "email": "[email protected]"
}
{
  "success": true,
  "data": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Verify code and get JWT token

post
Authorizations
Body
objectOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /auth/verification/verify-code HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "email": "[email protected]",
  "code": "965395"
}
{
  "success": true,
  "data": {
    "access_token": "text",
    "refresh_token": "text",
    "token_type": "text"
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Refresh JWT token

post
Authorizations
Body
refresh_tokenstringRequired

Refresh token to exchange for a new access token

user_uuidstringRequired

User UUID

Responses
200
Successful Response
application/json
422
Validation Error
application/json
post
POST /auth/verification/refresh-token HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 157

{
  "refresh_token": "sH3gSJXnigDEQ30mxb_DE97ghlXc4B2R5iudGsTBgUC9U-qU02gYHQugIoXRW_yd4I3Q_fKJyU3S2J5yXCmEfw",
  "user_uuid": "84fc585f-073e-4b30-8f74-e650d50c8622"
}
{
  "success": true,
  "data": {
    "access_token": "text",
    "refresh_token": "text",
    "token_type": "text"
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Revoke JWT token

post
Authorizations
Body
refresh_tokenstringRequired

Refresh token to revoke

Responses
200
Successful Response
application/json
Responseobject
422
Validation Error
application/json
post
POST /auth/verification/revoke-token HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "refresh_token": "text"
}
{}

List all API keys for the authenticated user

get
Authorizations
Query parameters
pageinteger · min: 1OptionalDefault: 1Example: 1
limitinteger · min: 1OptionalDefault: 10Example: 5
Header parameters
x-project-idstringRequired

Project ID to operate on

Example: 1a42c90f-02a6-434b-b9e6-43801a9314d0
x-api-keystringOptional

Auth with API Key, optional, just for test

Example: sk_GDjeKTfAaJwi4sLo-2AdimcK_Ya4l0KtU-4as2nJfJ8
Body
objectOptional
Responses
200
Successful Response
application/json
422
Validation Error
application/json
get
GET /auth/api-keys/ HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
x-project-id: text
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "prefix": "text",
        "name": "text",
        "full_key": "text",
        "scopes": [
          "text"
        ],
        "last_used_at": "2025-05-13T06:09:30.595Z",
        "expires_at": "2025-05-13T06:09:30.595Z",
        "is_active": true,
        "created_at": "2025-05-13T06:09:30.595Z",
        "updated_at": "2025-05-13T06:09:30.595Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 1,
      "total": 1,
      "pages": 1
    }
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Create a new API key

post
Authorizations
Header parameters
x-project-idstringRequired

Project ID to operate on

Example: 1a42c90f-02a6-434b-b9e6-43801a9314d0
Body
namestringRequired

API key name

expires_in_daysany ofOptional

Expiration in days (optional)

integerOptional
or
nullOptional
scopesany ofOptional

List of scopes (optional)

string[]Optional
or
nullOptional
Responses
201
Successful Response
application/json
422
Validation Error
application/json
post
POST /auth/api-keys/ HTTP/1.1
Host: localhost:8000
Authorization: Bearer YOUR_SECRET_TOKEN
x-project-id: text
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "name": "test",
  "expires_in_days": null,
  "scopes": null
}
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "prefix": "text",
    "name": "text",
    "full_key": "text",
    "scopes": [
      "text"
    ],
    "last_used_at": "2025-05-13T06:09:30.595Z",
    "expires_at": "2025-05-13T06:09:30.595Z",
    "is_active": true,
    "created_at": "2025-05-13T06:09:30.595Z",
    "updated_at": "2025-05-13T06:09:30.595Z"
  },
  "error": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}