Fortinet black logo

Administration Guide

API keys

API keys

Create and manage the API keys that allow access to the FortiGate CNF REST API.

The FortiGate CNF REST API allows you access to the following features:

  • AWS Accounts: Add, remove, and modify your connected AWS accounts.

  • AWS infrastructure: View details about VPCs in your connected AWS accounts.

  • FortiGate CNF instances: View, create, modify, and delete FortiGate CNF instances, as well as manage instance upgrades.

  • Gateway load balancer endpoints: View, create, modify, and delete gateway load balancer endpoints and add them to your FortiGate CNF instances.

  • Policy sets: View your policy sets.

  • Utility: Get the supported regions list.

To use the REST API:
  1. In the FortiGate CNF console, in the System submenu, click API keys.

  2. Click New.

  3. Enter a name for the key and click OK.

  4. Copy the key to your clipboard and click OK.

    API keys do not expire. To invalidate or disable an API key, you must delete it.

    Caution

    The key cannot be accessed again to copy, so you must copy it at this step. If you did not copy it or you lose the key, delete it and create a new one.

  5. Include this key in the 'X-Api-Key' header when making API requests.

    For example:

    curl -k -X 'POST' 'https://fortigatecnf.com/fortigatecnf/api/v1/aws-account/?action=download_cloudformation'
        -H 'accept: application/json'
        -H 'Content-Type: application/json'
        -H 'X-Api-Key: rSczzboi.2kaSXdrgkQ5eUhuRr73TifBQL1Y8Q7Xi'
        -d '{"aws_account_id": "444444444444", "aws_account_name": "ADFS-Admin/example@example.com"}'

For more information about the available APIs, see the FortiGate CNF API documentation on the Fortinet Developer Network (FNDN).

API keys

Create and manage the API keys that allow access to the FortiGate CNF REST API.

The FortiGate CNF REST API allows you access to the following features:

  • AWS Accounts: Add, remove, and modify your connected AWS accounts.

  • AWS infrastructure: View details about VPCs in your connected AWS accounts.

  • FortiGate CNF instances: View, create, modify, and delete FortiGate CNF instances, as well as manage instance upgrades.

  • Gateway load balancer endpoints: View, create, modify, and delete gateway load balancer endpoints and add them to your FortiGate CNF instances.

  • Policy sets: View your policy sets.

  • Utility: Get the supported regions list.

To use the REST API:
  1. In the FortiGate CNF console, in the System submenu, click API keys.

  2. Click New.

  3. Enter a name for the key and click OK.

  4. Copy the key to your clipboard and click OK.

    API keys do not expire. To invalidate or disable an API key, you must delete it.

    Caution

    The key cannot be accessed again to copy, so you must copy it at this step. If you did not copy it or you lose the key, delete it and create a new one.

  5. Include this key in the 'X-Api-Key' header when making API requests.

    For example:

    curl -k -X 'POST' 'https://fortigatecnf.com/fortigatecnf/api/v1/aws-account/?action=download_cloudformation'
        -H 'accept: application/json'
        -H 'Content-Type: application/json'
        -H 'X-Api-Key: rSczzboi.2kaSXdrgkQ5eUhuRr73TifBQL1Y8Q7Xi'
        -d '{"aws_account_id": "444444444444", "aws_account_name": "ADFS-Admin/example@example.com"}'

For more information about the available APIs, see the FortiGate CNF API documentation on the Fortinet Developer Network (FNDN).