--- description: ---

Rest API

Control your data from your own code using our powerful REST API.
Intial setup
  • To get started, you first need to create a new token from the My Account page.
  • Copy down the Token Key and Token Secret.
  • Next, you must add the token to the application that you wish to access. You can do this by going to the application and clicking on API Access.
  • Click on Add Token Access and select the token you wish to use.
  • This token will now be able to access this application.
  • Next, you must know the appUUID. Go to the Application Settings for your application and copy down the appUUID that is displayed there.
  • For every request to the API, you must have the following headers set.
    {
        "x-api-key": "Token Key",
        "x-api-secret": "Token Secret"
    }
                    
  • In each of the requests that you make, replace the {{appUUID}} value with the appUUID that you copied down earlier.
  • You must also replace {{resourceName}} with the name of the resource you with to access.
  • You can find a pre-existing set of requests to use in this Postman collection.



Find records

You can fetch any records from a resource from your application or an application that you have access to. The data that is fetched will be retrieved based on the permissions that you have for that resource. It will then apply any filters that are sent in the request body.

Request URL
POST
https://api.robostack.ai/external/api/{{appUUID}}/{{resourceName}}/
Request Body Samples
Match exact id
{
    "selection": {
        "id": 1
    }
}
    
Match all records in the resource whose quantity is exactly 10000 and has a status of pending
{
    "selection": {
        "status": "pending",
        "quantity": 10000
    }
}
    
Create records

You can create records in a resource from your application or an application that you have access to. The data that is created will be created based on the fields that you have access to.

Request URL
PUT
https://api.robostack.ai/external/api/{{appUUID}}/{{resourceName}}/
Request Body Samples
Insert one record
{
    "fieldName": "Field Value"
}
    
Insert multiple records
[
    {
        "fieldName": "Field Value 1"
    },
    {
        "fieldName": "Field Value 2"
    }
]
    
Update records

You can update records in a resource from your application or an application that you have access to. The data that is updated will be updated based on the fields and records that you have access to.

Request URL
PATCH
https://api.robostack.ai/external/api/{{appUUID}}/{{resourceName}}/
Request Body Samples
Update Single Record
{
    "selection": {
        "fieldName": "Matching Field Value"
    },
    "updation": {
        "fieldName": "New Field Value"
    }
}
    
Update Multiple Records
{
    "selection": [
        {
            "fieldName": "Matching Field Value"
        },
        {
            "fieldName": ""
        }
    ],
    "updation": [
        {
            "fieldName": "New Field Value"
        },
        {
            "fieldName": "Unknown Field Value"
        }
    ]
}
    
Delete records

You can delete records in a resource from your application or an application that you have access to. The data that is deleted will be deleted based on the fields and records that you have access to.

Request URL
DELETE
https://api.robostack.ai/external/api/{{appUUID}}/{{resourceName}}/
Request Body Samples
Delete Single Record
{
    "selection": {
        "fieldName": "Field Value"
    }
}
    
Delete Multiple Records
{
    "selection": [
        {
            "fieldName": ""
        },
        {
            "fieldName": "Unknown Field Value"
        }
    ]
}
    
Aggregate on records

You can run aggragations on data in resources of applications that you own or have access to. Aggregations work using an aggregation pipeline and the order in which these operations are done can affect the final output you get.

Request URL
POST
https://api.robostack.ai/external/api/{{appUUID}}/{{resourceName}}/aggregation
Request Body Samples
Coming soon