Skip to content

Get all email addresses of the authorized user

GET /api/v5/emails

Retrieves all email addresses associated with the user's current account, returning each email address and its verification state (such as verified), so users can review and manage their account email information.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
email string Yes — Email address
state string Yes — Email state, such as confirmed (verified)

Note: The response body is a JSON array of email objects; the table above describes the structure of each array element.

Error response

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid parameters or unparseable request"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The actual error field names returned by the backend take precedence.

HTTP status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 Request path does not exist
429 Too many requests; rate limit triggered
500 Internal system error

Request example

Parameter notes

<token> Replace with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/emails?access_token=<token>' -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/emails?access_token=<YOUR-TOKEN>", {
  headers: {
    "Accept": "application/json",
  },
});

if (!response.ok) {
  throw new Error("Request failed: " + response.status);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/emails",
    params={"access_token": "<YOUR-TOKEN>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "email": "my@dengmengmian.com",
    "state": "confirmed"
  },
  {
    "email": "xxxx@qq.com",
    "state": "confirmed"
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
400 Invalid parameters or unparseable request
404 Request path does not exist
405 Request method not supported
429 Too many requests; rate limit triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc