Skip to main content
/content

Add, update, and delete content from Promptitude's Content Storage.

Promptitude Team avatar
Written by Promptitude Team
Updated over a week ago

Your Promptitude API key is required to use each endpoint below, this shall be of type Bearer Token.


Add Content → Method POST

1- Adding from URL

➔ Google Drive URL Exception

If you want to add the path from Google Drive, consider the following factors:

Ensure this configuration is set, as it's a direct Google requirement. If the file you're accessing is external and lacks permission, you won't be able to access it with a service account or any other method without proper authorization from the owner.

Google Drive restricts access to files not shared with your account. If the file isn't public, or you lack explicit permission, retrieval through the Google Drive API or any other means won't be possible.

➔ Params Settings

fileUrl - required
The file's URL.

name - required
The name you want to give to your document.

folder - optional
Enter the name of the folder to associate with Content Storage.
If the folder doesn't exist, it will be created automatically.

tags - optional
Enter the name of the tags to associate with Content Storage, separated by "," (tag1,tag2,...) If the tag doesn't exist, it will be created automatically.

You can send the information as form-data or JSON:

➔ From Zapier:

2- Adding from Pull Request:

➔ Params Settings

externalId - requiredExternal ID of the Content Storage for future updates, we recommend the following structure:

  • github_{repositoryName}_{fileSha}

downloadUrl - required
URL of the file to download, this URL must be generated by GitHub:

name - required
The name you want to give to your document with extension.

size - optionalFile size in bytes

folder - optional
Enter the name of the folder to associate with Content Storage.
If the folder doesn't exist, it will be created automatically.

tags - optional
Enter the name of the tags to associate with Content Storage, separated by "," (tag1,tag2,...) If the tag doesn't exist, it will be created automatically.

3- Adding from Selected File:

➔ Params Settings

fileExtension - required
Extension of the file to upload.

content-type - required
Identifier of the file content.

  • pdf → application/pdf

  • docx → application/vnd.openxmlformats-officedocument.wordprocessingml.document

  • pptx→ application/vnd.openxmlformats-officedocument.presentationml.presentation

  • txt → text/plain

  • html → text/html

file - required
Format multipart/form-data

folder - optional
Optional: Enter the name of the folder to associate with Content Storage.
If the folder doesn't exist, it will be created automatically.

tags - optional
Optional: Enter the name of the tags to associate with Content Storage, separated by "," (tag1,tag2,...) If the tag doesn't exist, it will be created automatically.

You can send the information as form-data:

➔ From Zapier:


Add Content → Result Endpoint

Result returned by the Add Content Endpoint, when a file is added:

{ "message": "Content Storage created successfully!", "contentStorageProperties": { "id": "Jks9203lkd0...", "fileName": "Prompt.pdf", "size": 100, "name": "PDF", "fileUrl": "https://firebasestorage.googleapis.com", "creationDate": { "_seconds": 169029220, "_nanoseconds": 19402930, } "contentType": "application/pdf", "fileType": "pdf", "status": "waiting" } }


Update Content → Method POST

If you want to update a content storage, it is necessary to add the ID (internal or external) in the URL

1- Updating from URL

➔ Google Drive URL Exception

If you want to add the path from Google Drive, consider the following factors:

Ensure this configuration is set, as it's a direct Google requirement. If the file you're accessing is external and lacks permission, you won't be able to access it with a service account or any other method without proper authorization from the owner.

Google Drive restricts access to files not shared with your account. If the file isn't public, or you lack explicit permission, retrieval through the Google Drive API or any other means won't be possible.

➔ Params Settings

fileUrl - required
The file's URL.

fileName - required
File name without extension.

name - optional
If you want to update the name, add this property to the parameters.

description - optional
If you want to update the name, add this property to the parameters.

folder - optional
If you intend to update the folder, you should provide the name of the new folder. If the folder doesn't already exist, it will be automatically created.

tags - optional
If you intend to update the tags, you should provide the names of the new tags, separated by "," (tag1,tag2,...). If the tag doesn't already exist, it will be automatically created.

2- Updating from Commit URL:

➔ Params Settings

externalId - requiredExternal ID of the Content Storage for future updates, we recommend the following structure:

  • github_{repositoryName}_{fileSha}

downloadUrl - required
URL of the file to download, this URL must be generated by GitHub:

name - required
The name you want to give to your document with extension.

description - optional
If you want to update the name, add this property to the parameters.

folder - optional
If you intend to update the folder, you should provide the name of the new folder. If the folder doesn't already exist, it will be automatically created.

tags - optional
If you intend to update the tags, you should provide the names of the new tags, separated by "," (tag1,tag2,...). If the tag doesn't already exist, it will be automatically created.

3- Updating from Selected File

➔ Params Settings

fileExtension - required
Extension of the file to upload.

content-type - required
Identifier of the file content.

  • pdf → application/pdf

  • docx → application/vnd.openxmlformats officedocument.wordprocessingml.document

  • pptx→ application/vnd.openxmlformats-officedocument.presentationml.presentation

  • txt → text/plain

  • html → text/html

file - required
In multipart/form-data format

name - optional
In case you want to update the name, add this property to the parameters.

description - optional
In case you want to update the description, add this property to the parameters.

folder - optional
If you intend to update the folder, you should provide the name of the new folder. If the folder doesn't already exist, it will be automatically created.

tags - optional
If you intend to update the tags, you should provide the names of the new tags, separated by "," (tag1,tag2,...). If the tag doesn't already exist, it will be automatically created.


Delete Content → Method DELETE

Set the parameters in the URL:

Example:
https://api.promptitude.io
/v1/content/JJNaKHLptretg8...

Did this answer your question?