Update account information

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

https://api.useapi.net/v2/account

Request Headers
Authorization: Bearer {API token}
Request Body
{
    "name": "User name",
    "replyUrl": "Default callback URL to be used for all API endpoints, API will call the provided replyUrl once job completed or failed"
}
  • name optional, account user name.

  • replyUrl optional, provided value will be used as default value for all API calls unless you choose to override them for individual calls. Place here your callback URL. API will call the provided replyUrl once job completed or failed.
    Maximum length 1024 characters.
    We recommend using sites like webhook.site to test callback URL functionality.

Responses
  • 200 OK

    {
      "name": "User name",
      "email": "[email protected]",
      "created": "2023-08-316T21:03:28.558Z",
      "name": "Your Name",
      "verified": "2023-08-316T21:05:17.137Z",
      "sub": "230831",
      "replyUrl": "Call back URL here"
    }
    
  • 400 Bad Request

    {
      "error": "replyUrl is too long",
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  name: string,
  email: string,
  created: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC
  name: string,
  verified: string, // YYYY-MM-DDTHH:mm:ss.sssZ, IS0 8601, UTC
  sub: string, // YYMMDD
  replyUrl: string,
  error: string,
  errorDetails: string,
  code: number
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v2/account \
         -d '{"name": "…", "replyUrl": "…"}'
    
  • const apiUrl = "https://api.useapi.net/v2/account"; 
    const token = "API token";
    const user = "User name";      
    const replyUrl = "Callback URL";      
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      user, replyUrl
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    apiUrl = "https://api.useapi.net/v2/account" 
    token = "API token"
    user = "User name"
    replyUrl = "Callback URL"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    body = {
        "user": f"{user}", 
        "replyUrl": f"{replyUrl}"
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It