Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Self-Service RESTful API

Overview

The Self-Service RESTful API lets you read and change AttackForge data from your own scripts and systems: create projects, import vulnerabilities, download reports, upload files and more. Each user calls the API with their own API key, and can use only the API methods an administrator has given them.

Tip: For every API method and endpoint, see the API documentation.

Why it matters

Benefit

What it means

Automate repetitive work

Create projects, import findings and update records without clicking through the app

Connect your tools

Link AttackForge to ticketing, scanning, CI/CD, SIEM and reporting systems

Least privilege

Every method is off by default. Each user, or group, gets only the methods they need.

Each user has their own key

Requests are tied to a person, so access and activity are easy to trace

Act on a user's behalf

Administrators can run requests as another user, within that user's permissions

Who uses it

Role

Typical use

Administrators

Grant API methods to users and groups, and set up Run-As users

Developers and integration engineers

Build integrations with scanners, ticketing and CI/CD

Testers and consultants

Script imports, report downloads and bulk updates

Automation builders

Call the API from scripts, agents and other platforms

Choose the right integration

Use

When you want to

Read or change data from your own code, on demand

Run automation inside AttackForge when something happens, or on a schedule

Let users start a Flow from a button in the app

Let an AI assistant or agent work with your data

React to AttackForge events in your own systems.

See which API methods you can use

Go to Integration Docs in the main menu to see the API methods.

A padlock next to a method means you don't have access to it.

Important: Every API method is off by default for every user, including administrators.

You can get access in two ways:

  • An administrator gives you access to the method directly.

  • An administrator gives a group access to the method, and you're a member of that group.

Give users access to API methods

Give one user access

  1. Go to Users, select the user, and click Access.

  2. Expand Self-Service RESTful API, and click Add Methods.

  3. Select the methods, and click Add.

Give a group access

  1. Go to Groups, select the group, and click Other Access.

  2. Expand Self-Service RESTful API, and click Add Methods.

  3. Select the methods, and click Add.

Note: Every member of the group can use the methods you give the group.

Create your API key

  1. Log in to AttackForge, and go to Profile.

  2. Click Secrets.

  3. Under API Key, click View Key, Copy Key or Rotate Key.

Warning: Users can only create, view and rotate their own key. Administrators can't do this for other users.

Rotating your key stops the old key working straight away, so update any script that uses it.

Make your first request

Send your API key in the X-SSAPI-KEY header with each request.

This example lists the projects you can see. Replace {{ATTACKFORGE-HOSTNAME}} with your hostname and {{API-KEY}} with your key:

The request works only if you have access to that method. For each method's URL, parameters and response, see the API documentation.

Run requests as another user

Administrators can make API requests on behalf of another user. Use this to:

  • run automation as the right person

  • troubleshoot a user's problem

  • check what a user can see and do

  • keep permissions tight, while managing everything from one admin API key

Set it up

  1. Go to Users > Access > Self Service RESTful API > Run-As Users, and add the users you need.

  2. Copy each user's System ID. Hover over the user in the table to copy it.

  3. Send the x-run-as-user-id header, set to that System ID, with your API key. The request runs as that user.

Run-As Users are added on the administrator's own access, not on each user's.

Example:

How it stays secure

  • The request can use only the API methods the user already has. Run-As never adds permissions.

  • Only non-admin users can be added as Run-As users.

Tips

  • Grant methods to groups. Group access is easier to manage and review than user-by-user access.

  • Give the fewest methods you can. Start with read methods, and add write methods only when they're needed.

  • Use a dedicated user for integrations. An integration with its own user and key is easy to trace and to switch off.

  • Keep your key secret. Store it in a secrets manager or environment variable, never in code or a shared file.

  • Rotate keys regularly, and straight away if one may have been exposed.

  • Use Run-As to test permissions. Check what a user can see and do without asking for their key.

  • Store reports back on the project. Upload a generated report with the API so it's kept with the project. See Report automation.

  • Consider AI MCP for ad hoc questions. If people want to ask questions of their data rather than build an integration, AI MCP may suit them better.

FAQ

Why do I see a padlock next to a method? You don't have access to it. Ask an administrator to give you, or one of your groups, access.

I'm an administrator. Why can't I use the API? Every method is off by default, including for administrators. Give yourself access to the methods you need.

Can an administrator create or see my API key? No. Only you can create, view and rotate your own key.

What happens to my scripts when I rotate my key? The old key stops working, so update your scripts with the new key.

Can Run-As give a user more access? No. A Run-As request can use only the methods that user already has.

Can I run requests as another administrator? No. Only non-admin users can be Run-As users.

Where can I find a user's System ID? In the Run-As Users table, hover over the user to copy it.

Where's the full list of API methods? In Integration Docs in the app, and in the API documentation.

Last updated