Naijacloud
Docs

Account

Every /v1 route for account. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.

Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.

The signed-in person (or the owner of the API key)

GET /v1/me

Key scopes: READ and PLATFORM_API.

Returns

bash
curl "https://api.naijacloud.com/v1/me" \ -H "Authorization: Bearer $NC_API_KEY"

Sign in with email and password

POST /v1/auth/login

Returns a session token for Authorization: Bearer. On an account with two-factor on, accessToken is null and twoFactor.pendingToken goes to POST /v1/auth/two-factor. Throttled to 10 a minute; failures count towards the account lockout.

Key scopes: WRITE and PLATFORM_API.

Body

FieldTypeRequiredNotes
emailstring (email)yes
passwordstringyes

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/auth/login" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"email":"…","password":"…"}'

Finish a sign-in that asked for a two-factor code

POST /v1/auth/two-factor

Each code works once; five wrong codes lock the account for 15 minutes.

Key scopes: WRITE and PLATFORM_API.

Body

FieldTypeRequiredNotes
pendingTokenstringyesThe pendingToken the sign-in returned.
codestringyesA 6-digit authenticator code, or a one-time recovery code.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/auth/two-factor" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"pendingToken":"…","code":"…"}'

Types

V1Me

FieldTypeNotes
idstring (uuid)
emailstring (email)
firstNamestring, or null
lastNamestring, or null
emailVerifiedAtstring (date-time), or nullWhen the email address was confirmed; null until then.
createdAtstring (date-time)

V1Session

FieldTypeNotes
accessTokenstring, or null
userV1Me, or null
twoFactorV1TwoFactorChallenge, or null

V1TwoFactorChallenge

FieldTypeNotes
pendingTokenstringSend to POST /v1/auth/two-factor with a code.
expiresAtstring (date-time)