Actions86
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Environment Actions
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Setting Actions
- Stack Actions
- System Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Config → Delete
AI-generatedOverview
This node operation deletes a Docker Swarm config in a specified environment using the Portainer API. It is useful for managing Docker Swarm configurations by removing obsolete or unwanted configs programmatically.
Use Case Examples
- Deleting a Docker Swarm config by specifying its Config ID and Environment ID in Portainer.
- Force deleting a config even if it is currently in use.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the environment/endpoint in Portainer where the config exists. |
| Config ID | The ID of the Docker Swarm config to be deleted. |
| Force Delete | Whether to force deletion even if the config is currently in use. |
Output
JSON
statusCode- HTTP status code of the delete operation response.body- Response body from the Portainer API after attempting to delete the config.
Dependencies
- Portainer API with an API key credential for authentication
Troubleshooting
- Ensure the Environment ID and Config ID are correct and exist in Portainer.
- If forceDelete is false and the config is in use, deletion will fail; set forceDelete to true to override.
- Check API key permissions to ensure the user has rights to delete configs.
- Common error messages include 404 Not Found if the config does not exist, or 403 Forbidden if the API key lacks permissions.
Links
- Portainer API Docker Swarm Configs - Official Portainer API documentation for managing Docker Swarm configs, including deletion.