HTTP methods, headers, and status codes

This chapter summarises the HTTP methods, status codes, and headers that can be used to call the Investment API and lists response options.

HTTP methods

HTTP methodPurpose
GETReturns a list of resources or a single resource, depending on the call.
POSTCreates a new resource synchronously and returns 201 Created or creates a new resource and starts the asynchronous processing required to complete the creation. In this case return code is 202 Accepted.
PATCHUpdates a resource's information.
DELETEDeletes an instance of a resource where allowed and returns 204 No Content.
NOTE
Some resources may allow only partial data change.

HTTP headers

There are some mandatory headers for each call.

HeaderPurposeAllowed values
acceptSpecification of media types that are accepted for the response.application/json
application/pdf
authorization Bearer access token.Bearer: <your access token>
content-length Size of the entity request body.-
content-type Media type of the entity request body.application/json
application/x-www-form-urlencoded
idempotency-keyKey for idempotency protection.
upvest-client-id Tenant ID-
upvest-api-version Major version of the API to request.1
NOTE
  • content-length and content-type headers required only for requests that contain a request body.
  • idempotency-key required only for POST and PATCH operations.
  • upvest-api-version is optional and has a default value of 1. (Note: you should not place quotes around this value despite it being defined as being a string)

HTTP status codes

We return the following HTTP status codes from our endpoints.

Success status codes (2xx)

HTTP status codeStatus messagePurpose
200OKThe call has been completed.
201CreatedThe new resource has been fully created.
202AcceptedThe request processing has been started succesfully but will be completed asynchronously.
204No ContentThe resource has been succesfully deleted.

Client error status codes (4xx)

HTTP status codeStatus messagePurpose
400Bad RequestThe incoming request was malformed.
401UnauthorizedThe caller could not be authenticated.
403ForbiddenThe caller is not allowed to take this action.
404Not FoundThe specified resource was not found.
405Method Not AllowedThe requested HTTP method is not allowed on this resource.
406Not AcceptableThe resource does not have a current representation that would be acceptable to the user agent. The "Accept" header defined an unsupported value.
426Upgrade RequiredThe request for an older version of the API after it has been retired.
429Too Many RequestsThe caller was throttled due to exceeding the call quota.

Server error status codes (5xx)

HTTP status codeStatus messagePurpose
500Internal Server ErrorSomething unexpectedly went wrong with the service. Please reach out to our support.
503Service UnavailableThe receiving service could not be reached. Please try again.

Was this page helpful?