Success Responses

Learn about the structure and details of successful API responses from Picsart, including status codes and data formats.

When the API call is successful accepted (and processed), Picsart usually returns a data object or array with a 2xx HTTP response code. The body is a JSON that includes the status confirmation (success) and the data that holds the result information as in the following example.

{
  "data": {
    "id": "string",
    "url": "string"
  },
  "status": "success"
}

Depending on the service, you may get one file result as in the above example, or you may also get a list of result files:

{  
  "data": [{  
    "id": "string",  
    "url": "string"  
  }, {  
    "id": "string",  
    "url": "string"  
  }... ],  
  "status": "success"  
}

In some cases, when the request is performed asynchronously, you may also get a reference identifier that can be used in other endpoints (usually performed with GET requests) to retrieve the result:

{  
  "status": "success",  
  "inference_id": "1e7113fa-ff37-4871-96b5-79470da5008a"  
}

This type of asynchronous executions usually use the 202 code (instead of the 200 that used for synchronous executions).

📘

Success responses return a 2xx response code.

The complete list of codes:

Error CodeMessageDescription
200SuccessCongratulations, your call was successful. This code indicates that the API request was successfully processed by the server.
202AcceptedSignifies that the server has received the request but has not yet completed it. This status is used for asynchronous processes where operations are pending and may require extended time to finish. The response may include a way to check the request's progress.

📘

When there's an error, the API returns an error object instead. Errors return a 4xx or 5xx response code.

See also

IETF HTTP status code registry
RFC 2616, section 6.1.1
HTTP status codes on Wikipedia