Add email addresses
POST
/user/emails
const url = 'https://gitea.example.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.example.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”CreateEmailOption options when creating email addresses
object
emails
Email addresses to add
Array<string>
Examplegenerated
{ "emails": [ "example" ]}CreateEmailOption options when creating email addresses
object
emails
Email addresses to add
Array<string>
Responses
Section titled “Responses”EmailList
Media typeapplication/json
Array<object>
Email an email address belonging to a user
object
email
string format: email
primary
boolean
user_id
integer format: int64
username
string
verified
boolean
Examplegenerated
[ { "email": "hello@example.com", "primary": true, "user_id": 1, "username": "example", "verified": true }]APIValidationError is error format response related to input validation
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string