Actions52
- ApiKeys Actions
- Auth Actions
- Identities Actions
- Members Actions
- Messages Actions
- Platform Logs Actions
- Platforms Actions
- Projects Actions
- Webhooks Actions
Overview
This node operation allows you to create a new API key within a specified project in the MsgCore messaging platform. The API key can be assigned specific scopes (permissions) and an optional expiration period. This is useful for programmatically managing access credentials that enable secure interaction with the MsgCore API, such as sending messages or managing resources.
Typical use cases include:
- Automating the generation of API keys for different services or environments.
- Creating scoped API keys with limited permissions for enhanced security.
- Setting expiration dates on API keys to enforce credential rotation policies.
For example, you might create an API key named "IntegrationKey" with read/write permissions on messages, valid for 30 days, to allow a third-party service to send and receive messages securely.
Properties
| Name | Meaning |
|---|---|
| API key name | The name to assign to the new API key. |
| Array of scope strings (e.g., ["messages:read", "messages:write"]) | A string representing an array of permission scopes granted to the API key. |
| Expiration in days | Optional number specifying how many days until the API key expires. |
| Project | Identifier of the project under which the API key will be created. |
Output
The output JSON contains the response from the MsgCore API after creating the API key. This typically includes details about the newly generated API key such as its ID, name, scopes, creation date, and expiration date if set.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to the MsgCore API via an API authentication token configured in n8n credentials.
- The node uses the base URL provided by the API credentials to make HTTP POST requests to the endpoint
/api/v1/projects/{project}/keys.
Troubleshooting
- Missing required parameters: Ensure that the API key name, scopes, and project identifier are provided; otherwise, the API will reject the request.
- Invalid scopes format: The scopes property must be a properly formatted string representing an array of scope strings (e.g.,
["messages:read","messages:write"]). Incorrect formatting may cause errors. - Authentication errors: Verify that the API authentication token is valid and has sufficient permissions to create API keys.
- Expired or invalid project ID: Confirm that the project identifier exists and is accessible with your credentials.
- API rate limits or server errors: If the API returns rate limit or server error responses, retry after some time or check the service status.
Links and References
- MsgCore API Documentation (replace with actual URL if available)
- General best practices for API key management and security.