Add email addresses
POST
/user/emails
const url = 'https://gitea.com/api/v1/user/emails';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"emails":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://gitea.com/api/v1/user/emails \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "emails": [ "example" ] }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
CreateEmailOption
Options when creating email addresses
object
emails
Email addresses to add
Array<string>
Examplegenerated
{ "emails": [ "example" ]}Responses
Section titled “Responses”EmailList
Media typeapplication/json
Array<object>
EmailAn email address belonging to a user
object
email
The email address
string format: email
primary
Whether this is the primary email address
boolean
user_id
The unique identifier of the user who owns this email
integer format: int64
username
Username of the user
string
verified
Whether the email address has been verified
boolean
Examplegenerated
[ { "email": "hello@example.com", "primary": true, "user_id": 1, "username": "example", "verified": true }]APIError is error format response
Headers
Section titled “Headers”message
string
url
string
APIError is error format response
Headers
Section titled “Headers”message
string
url
string
APIValidationError is error format response related to input validation
Headers
Section titled “Headers”message
string
url
string