Suggest a title and description
SDK platic.files.suggestMetadata()
Ask AI to suggest a title and description from the file’s content. Send its fileId; if you want to use the suggestion, save it with Update a file. This request saves no changes.
Example
curl -X POST "https://api.platic.ai/v1/files/$FILE_ID/metadata/suggestion" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fields": ["title", "description"] }' await platic.files.suggestMetadata("file_123"); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
fileId | string | The file | ✓ |
Request body
Optional. Without a body, it suggests both:
{ "fields": ["title", "description"] } | Field | Type | Description | Default |
|---|---|---|---|
fields | array | What to suggest: title, description or both. | Both |
Response
{
"status": "success",
"data": {
"title": "Returns and refunds policy",
"description": "Deadlines to return a product, conditions, exceptions and how the refund is made. Consult it when the customer wants to return or exchange something."
}
} Response fields
| Field | Type | Description |
|---|---|---|
title | string | Suggested title, up to 200 characters. |
description | string | Suggested description, up to 1024 characters. |
The suggestion comes in the language of the content (Spanish if it is not clear).
Errors
| Status | details.code | When |
|---|---|---|
403 | RESOURCE_NOT_ACCESSIBLE | You do not have Integrations nor can you edit all the agents that use it. |
409 | FILE_NOT_READY | The file does not have content ready yet. |
410 | FILE_DELETED | The file was already deleted. |
503 | INTERNAL_ERROR | The model did not answer. Try again. |
The ones that apply to all operations are in common errors.
Notes
- You do not need to ask for it when creating: if you create a file without a title or without a description, Platica generates them by itself when the content is ready (see automatic names).
- It requires the same permission as Get a file.