latestOpenAPI 3.0.3GitGuardian2026-08-201871515.0 MB

511b067cdcb1

Honeytokens

Create a honeytoken within a context

This endpoint allows you to create a honeytoken of a given type within a context. The context is a realistic file in which your honeytoken is inserted.

If language, project_extensions and filename are not provided, a random context will be generated.

post/v1/honeytokens/with-context

Request body

namestring required

Honeytoken name.

descriptionstring

Honeytoken description.

type'AWS' required

Honeytoken type.

languagestring

Language to use for the context. If not set but project_extensions is set, the languages will be inferred from the extensions.

filenamestring

Filename to use for the context.

project_extensionsstring[]

An array of file extensions that can be used for the context.

Example request

{
  "name": "honeytoken name",
  "description": "This honeytoken was placed in the repository test",
  "type": "AWS",
  "custom_tags": [
    {
      "id": "d45a123f-b15d-4fea-abf6-ff2a8479de5b",
      "key": "env",
      "value": "prod"
    }
  ],
  "language": "python",
  "filename": "test_config.py",
  "project_extensions": [
    ".c",
    ".h"
  ]
}

Response

Honeytoken within a context created

contentstring
filepathstring
languagestring
suggested_commit_messagestring

Suggestion of a commit message to use

honeytoken_idstring uuid
gitguardian_urlstring

URL of the honeytoken on the dashboard

Example response

{
  "filepath": "config_prod.py",
  "language": "python",
  "suggested_commit_message": "adding test config",
  "honeytoken_id": "d45a123f-b15d-4fea-abf6-ff2a8479de5b",
  "gitguardian_url": "https://dashboard.gitguardian.com/workspace/1/honeytokens/948025a2-6969-493c-8696-3849c1e9f769"
}