Docs
Account, keys and webhooks ›

Export account

GET/v1/me/export

Everything kept about the account and you, as one JSON document.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const account = await agental.exportAccount();
Answer200 OK · AccountExport
  1. {
  2. "exportedAt": string,
  3. "account": {
  4. "id": string,
  5. "email": string | null,
  6. "name": string,
  7. "role": string,
  8. "emailVerified": boolean,
  9. "createdAt": string | null,
  10. … 4 more
  11. },
  12. "signupSource": {
  13. "referrer": string | null,
  14. "utmSource": string | null,
  15. "utmMedium": string | null,
  16. "utmCampaign": string | null,
  17. "landingPage": string | null,
  18. "heard": string | null,
  19. },
  20. "closed": object,
  21. "sessions": [{
  22. "id": string,
  23. "createdAt": string,
  24. "expiresAt": string,
  25. "ipAddress": string | null,
  26. "userAgent": string | null,
  27. "current": boolean,
  28. }],
  29. "organizations": [{
  30. "id": string,
  31. "createdAt": string,
  32. "name": string,
  33. "personal": boolean,
  34. }],
  35. "apiKeys": [{
  36. "id": string,
  37. "name": string,
  38. "prefix": string | null,
  39. "createdAt": string,
  40. "preset": "read-only" | "full-sandbox" | "ci" | "admin" | "null" | null,
  41. "actions": string[],
  42. … 8 more
  43. }],
  44. "invitesSent": [{
  45. "email": string,
  46. "createdAt": string,
  47. }],
  48. "billing": {
  49. "customerId": string | null,
  50. "subscriptionId": string | null,
  51. "planId": string | null,
  52. "status": string,
  53. "periodStart": string | null,
  54. "periodEnd": string | null,
  55. … 1 more
  56. },
  57. … 8 more
  58. }

Everything kept about the account and the person behind it: the account, its sessions with the address and browser each began from, keys, billing, payments, usage, and what it has made.

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 Everything kept about the account and the person behind it: the account, its sessions with the address and browser each began from, keys, billing, payments, usage, and what it has made. Secrets are named, never given. What is in sandboxes is read through the rest of the API.

AccountExport17 fields
exportedAt
string
account
object10 fields
id
string
email
stringnull
name
string
role
string
emailVerified
boolean
createdAt
stringnull
image
stringnull
The picture GitHub or Google gave, as an address.
signInMethods
string[]
password, github or google.
More A code sent by email keeps nothing of its own.
twoFactor
boolean
Whether two-factor sign-in is on.
More Its secret and backup codes are kept sealed and are not given.
passkeys
object[]3 fields
The passkeys it signs in with.
More Only each one's public key is kept, which is of no use to anyone else.
id
string
name
stringnull
createdAt
string
signupSource
objectnull6 fields
Where the account came from, as its browser said when it signed up: the referring address without its query, the utm_ words of the first link, the first page, and the answer to "How did you hear about agental?".
More Null where none was kept.
referrer
stringnull
utmSource
stringnull
utmMedium
stringnull
utmCampaign
stringnull
landingPage
stringnull
heard
stringnull
closed
object
sessions
object[]6 fields
id
string
createdAt
string
expiresAt
string
ipAddress
stringnull
The address the session was started from.
userAgent
stringnull
The browser or program it was started from, as it named itself.
current
boolean
Whether it is the session this export was asked for with.
organizations
object[]4 fields
id
string
createdAt
string
name
string
personal
boolean
apiKeys
object[]14 fields
The account's keys, by name and first characters, with what each may do and where.
More A key itself is never kept, so it cannot be given.
id
string
name
string
prefix
stringnull
The first characters of the secret, to tell keys apart by.
More Null for a key from before they were kept.
createdAt
string
preset
read-onlyfull-sandboxciadminnullnull
The preset the key was made with.
More Null for one made with its actions named.
actions
string[]
What the key may do, as it was made: a preset is written out into its actions then, so a preset that grows later does not widen it.
More * is everything.
sandboxIds
string[]
The sandboxes the key is limited to, with templateIds.
More Empty, with templateIds empty too, is every sandbox of the account.
templateIds
string[]
The templates the key is limited to: it reaches them and every sandbox on them.
More Empty is every template, and, with sandboxIds empty too, every sandbox.
expiresAt
stringnull
When the key stops working.
More Null is never.
allowFrom
string[]
The addresses and ranges the key may be used from.
More Empty is anywhere.
lastUsedAt
stringnull
When the key was last used, to the minute: it is written once a minute at most.
More Null if never.
lastUsedFrom
stringnull
The address it was last used from.
organizationId
stringnull
The organization the key acts in: the one it was made in, for good.
More Null for a key of whoever runs the service.
createdBy
stringnull
The account that made it.
More In a team, its owners and admins see every key of the team, and a member only those they made.
invitesSent
object[]2 fields
email
string
createdAt
string
billing
objectnull7 fields
Null for an account that has never bought anything.
customerId
stringnull
The account's id at the payment provider.
subscriptionId
stringnull
planId
stringnull
status
string
periodStart
stringnull
periodEnd
stringnull
cardSavedAt
stringnull
When a card was first saved on the free plan, or null.
payments
object[]6 fields
id
string
kind
string
micros
integer
test
boolean
reference
string
receivedAt
string
credit
object[]5 fields
id
string
micros
integer
kind
string
reference
string
createdAt
string
usage
object[]5 fields
sandboxId
string
size
string
microsPerHour
integer
startedAt
string
endedAt
stringnull
sandboxes
object[]5 fields
id
string
createdAt
string
name
string
size
string
status
string
snapshots
object[]4 fields
id
string
createdAt
string
sandboxId
string
name
string
templates
object[]3 fields
id
string
createdAt
string
name
string
webhooks
object[]5 fields
Without their signing secrets.
id
string
createdAt
string
url
string
events
string[]
description
string
telemetry
objectnull6 fields
endpoint
string
headers
string[]
The names of the headers sent with each export.
More Their values are not given.
lastExportAt
stringnull
lastError
stringnull
createdAt
string
updatedAt
string

Errors and other answers

400no_account the key belongs to no account.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.