scientific-skills/protocolsio-integration/references/protocols_api.md
The Protocols API is the core functionality of protocols.io, supporting the complete protocol lifecycle from creation to publication. This includes searching, creating, updating, managing steps, handling materials, bookmarking, and generating PDFs.
All protocol endpoints use the base URL: https://protocols.io/api/v3
Many endpoints support a content_format parameter to specify how content is returned:
json: Draft.js JSON format (default)html: HTML formatmarkdown: Markdown formatInclude this as a query parameter: ?content_format=html
Retrieve protocols with filtering and pagination.
Endpoint: GET /protocols
Query Parameters:
filter: Filter type
public: Public protocols onlyprivate: Your private protocolsshared: Protocols shared with youuser_public: Another user's public protocolskey: Search keywords in protocol title, description, and contentorder_field: Sort field (activity, created_on, modified_on, name, id)order_dir: Sort direction (desc, asc)page_size: Number of results per page (default: 10, max: 50)page_id: Page number for pagination (starts at 0)fields: Comma-separated list of fields to returncontent_format: Content format (json, html, markdown)Example Request:
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://protocols.io/api/v3/protocols?filter=public&key=CRISPR&page_size=20&content_format=html"
Retrieve a protocol by its DOI.
Endpoint: GET /protocols/{doi}
Path Parameters:
doi: The protocol DOI (e.g., dx.doi.org/10.17504/protocols.io.xxxxx)Endpoint: GET /protocols/{protocol_id}
Path Parameters:
protocol_id: The protocol's unique identifierQuery Parameters:
content_format: Content format (json, html, markdown)Response includes:
Endpoint: POST /protocols
Request Body Parameters:
title (required): Protocol titledescription: Protocol descriptiontags: Array of tag stringsvendor_name: Vendor/company namevendor_link: Vendor website URLwarning: Warning or safety messageguidelines: Usage guidelinesmanuscript_citation: Citation for related manuscriptlink: External link to related resourceExample Request:
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "CRISPR Gene Editing Protocol",
"description": "Comprehensive protocol for CRISPR-Cas9 mediated gene editing",
"tags": ["CRISPR", "gene editing", "molecular biology"]
}' \
"https://protocols.io/api/v3/protocols"
Endpoint: PATCH /protocols/{protocol_id}
Path Parameters:
protocol_id: The protocol's unique identifierRequest Body: Same parameters as create, all optional
Endpoint: POST /protocols/{protocol_id}/steps
Request Body Parameters:
title (required): Step titledescription: Step description (HTML, Markdown, or Draft.js JSON)duration: Step duration in secondstemperature: Temperature settingcomponents: Array of materials/reagents usedsoftware: Software or tools requiredcommands: Commands to executeexpected_result: Expected outcome descriptionExample Request:
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Prepare sgRNA",
"description": "Design and synthesize single guide RNA (sgRNA) targeting your gene of interest",
"duration": 3600,
"temperature": 25
}' \
"https://protocols.io/api/v3/protocols/12345/steps"
Endpoint: PATCH /protocols/{protocol_id}/steps/{step_id}
Parameters: Same as create step, all optional
Endpoint: DELETE /protocols/{protocol_id}/steps/{step_id}
Endpoint: POST /protocols/{protocol_id}/steps/reorder
Request Body:
step_order: Array of step IDs in desired orderRetrieve all materials and reagents used in a protocol.
Endpoint: GET /protocols/{protocol_id}/materials
Response includes:
Issue a DOI and make the protocol publicly available.
Endpoint: POST /protocols/{protocol_id}/publish
Request Body Parameters:
version_notes: Description of changes in this versionpublish_type: Publication type
new: First publicationupdate: Update to existing published protocolImportant Notes:
Example Request:
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version_notes": "Initial publication",
"publish_type": "new"
}' \
"https://protocols.io/api/v3/protocols/12345/publish"
Add a protocol to your bookmarks for quick access.
Endpoint: POST /protocols/{protocol_id}/bookmarks
Endpoint: DELETE /protocols/{protocol_id}/bookmarks
Endpoint: GET /bookmarks
Generate a formatted PDF version of a protocol.
Endpoint: GET /view/{protocol_uri}.pdf
Query Parameters:
compact: Set to 1 for compact view without large spacingRate Limits:
Example:
https://protocols.io/api/v3/view/crispr-protocol-abc123.pdf?compact=1
To import and work with an existing protocol:
/protocols/{protocol_id}To create a new protocol:
POST /protocolsPOST /protocols/{id}/stepsPOST /protocols/{id}/publishTo update an already-published protocol:
GET /protocols/{protocol_id}PATCH /protocols/{protocol_id}POST /protocols/{protocol_id}/publish with publish_type: "update"To create a modified version of an existing protocol:
Common error responses:
400 Bad Request: Invalid parameters or request format401 Unauthorized: Missing or invalid access token403 Forbidden: Insufficient permissions for the operation404 Not Found: Protocol or resource not found429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server-side errorImplement retry logic with exponential backoff for 429 and 500 errors.