Before you can access our API, you will need at least two pieces of identifying information: your bearer token, and your Workspace (Organization) ID. For some APIs, you may also need your unique User ID. All of these can be accessed through the authorization endpoint, as described below. Before you can use the endpoint, you will need some software that can use APIs, such as cURL or Python.Documentation Index
Fetch the complete documentation index at: https://docs.petal.org/llms.txt
Use this file to discover all available pages before exploring further.
Authorization endpoint
The API endpoint for authorization ishttps://cite.petal.org/api/auth. You will need to send a POST request to the endpoint, with the following parameters:
The email you use to sign in on Petal
Your password
your_email@example.com and your_password with your actual login credentials.
A cryptic bearer token that identifies you. It will be needed for all other API access.
Your unique User ID.
A list of the unique IDs of all Workspaces (also called Organizations) of which you are part.
A list of your roles in all your Workspaces. Follows the same order as the
organization_ids parameter.Specifying your Workspace (Organization) ID
To do this, you should make a GET request to thehttps://cite.petal.org/api/user/<id>/organization/list endpoint. You will need to provide the bearer token you have just obtained from the previous step, as well as your user ID. Replace the sample values with your own in the code example below to get started.
name and description for each Organization in the list. The is_personal field indicates whether the Organization is a personal one (created automatically upon user account creation). Using a combination of these fields, you should be able to identify the Organization you wish to work with.
Once you have noted down the unique ID (in the id field), you are all set to begin to use our API for the correct Workspace.
What would you like to do next?
Upload documents
Upload your documents to Petal for cloud processing
Chat with documents
Converse with AI about the contents of your documents
Build AI tables
Extract information from your documents in this initutive format
