Enhance your Posta API objects with custom metadata
Metadata allows you to attach custom key-value pairs to Posta API objects, enabling better organization, filtering, and integration with your internal systems.
When creating or updating Posta objects, you can include key-value pairs of custom metadata. This feature is particularly useful for:
Metadata in the Posta API is structured as an array of key-value pairs:
Here are some examples of how you might use metadata:
You can specify a key without a value, as shown in the “highPriority” example above. This can be useful for boolean-like flags where the presence of the key indicates true
.
internalId
instead of id
).Metadata is searchable and can be used to organize and filter your Posta objects efficiently. However, it’s not intended for storing sensitive information.
While the specific endpoints for working with metadata may vary depending on the object type, here are general principles for interacting with metadata:
When creating or updating an object, include the metadata array in your request body:
Adding metadata example
When you fetch an object, its metadata will be included in the response.
Retrieving metadata example
You can update metadata on existing objects using the update endpoints. This will replace the entire metadata array.
Updating metadata example
Many list endpoints support filtering objects based on metadata. See each endpoint’s documentation for details.
Remember to refer to the specific API endpoint documentation for detailed information on how to interact with metadata for each object type.
Avoid using metadata for data that changes frequently, as this can impact performance. For frequently changing data, consider using a dedicated field or a separate system.
Enhance your Posta API objects with custom metadata
Metadata allows you to attach custom key-value pairs to Posta API objects, enabling better organization, filtering, and integration with your internal systems.
When creating or updating Posta objects, you can include key-value pairs of custom metadata. This feature is particularly useful for:
Metadata in the Posta API is structured as an array of key-value pairs:
Here are some examples of how you might use metadata:
You can specify a key without a value, as shown in the “highPriority” example above. This can be useful for boolean-like flags where the presence of the key indicates true
.
internalId
instead of id
).Metadata is searchable and can be used to organize and filter your Posta objects efficiently. However, it’s not intended for storing sensitive information.
While the specific endpoints for working with metadata may vary depending on the object type, here are general principles for interacting with metadata:
When creating or updating an object, include the metadata array in your request body:
Adding metadata example
When you fetch an object, its metadata will be included in the response.
Retrieving metadata example
You can update metadata on existing objects using the update endpoints. This will replace the entire metadata array.
Updating metadata example
Many list endpoints support filtering objects based on metadata. See each endpoint’s documentation for details.
Remember to refer to the specific API endpoint documentation for detailed information on how to interact with metadata for each object type.
Avoid using metadata for data that changes frequently, as this can impact performance. For frequently changing data, consider using a dedicated field or a separate system.