DKIM Keys API
- Table of Contents
- Overview
- Attributes
- Get a List of DKIM Keys
- Get Details on a Single DKIM Key
- Create a DKIM Key
- Update a DKIM Key
- Delete a DKIM Key
Overview
GreenArrow Engine can digitally sign outgoing messages using DKIM.
Attributes
The following attributes are defined for DKIM Keys:
| dkim_key hash/ required 
 | |||||||||||||||||||||||||||
Get a List of DKIM Keys
GET /ga/api/v3/eng/dkim_keys
GET /ga/api/v3/eng/dkim_keys?page={page}
GET /ga/api/v3/eng/dkim_keys?page_token={page_token}
Parameters
| page integer/ optional | The page number to retrieve. Page numbering starts at  | 
| page_token string/ optional | The  | 
Response
The response will contain a list of DKIM Keys in the following format.
| dkim_keys array of hashes 
 | |||||||||||
| pagination hash 
 | |||||||||||
Example
GET /ga/api/v3/eng/dkim_keys
HTTP/1.1 200 OK
{
  "success": true,
  "data": {
    "dkim_keys": [
      {
        "id": 1,
        "domain": "my-domain.com",
        "selector": "default",
        "default_for_domain": false,
        "key_bits": 32
      },
      {
        "id": 2,
        "domain": "domain.com",
        "selector": "default",
        "default_for_domain": false,
        "key_bits": 128
      },
      {
        "id": 3,
        "domain": "domain-3.com",
        "selector": "default",
        "default_for_domain": true,
        "key_bits": 64
      }
    ],
    "pagination": {
      "page": 0,
      "per_page": 100,
      "num_pages": 1,
      "num_records": 3,
      "next_page_token": null
    }
  },
  "error_code": null,
  "error_messages": null
}
Get Details on a Single DKIM Key
GET /ga/api/v3/eng/dkim_keys/{id}
Response
The response will contain details on the requested record.
| dkim_key hash | The attributes for this hash are defined in the Attributes section of this document. | 
Example
GET /ga/api/v3/eng/dkim_keys/1
HTTP/1.1 200 OK
{
  "success": true,
  "data": {
    "dkim_key": {
      "id": 1,
      "domain": "my-domain.com",
      "selector": "default",
      "default_for_domain": false,
      "key": {
        "bits": 32,
        "private": "-----BEGIN RSA PRIVATE KEY-----\nMC0CAQACBQCoJLcxAgMBAAECBBur+skCAwDfNwIDAMDXAgMAhSECAkWhAgMAyzU=\n-----END RSA PRIVATE KEY-----",
        "public": "MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKgktzECAwEAAQ"
      },
      "dns": {
        "public_key": {
          "name": "default._domainkey.my-domain.com",
          "type": "TXT",
          "value": "k=rsa; p=MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKgktzECAwEAAQ"
        }
      }
    }
  },
  "error_code": null,
  "error_messages": null
}
Create a DKIM Key
POST /ga/api/v3/eng/dkim_keys
Payload
| dkim_key hash/ required | An object as described in the Attributes section of this page. All required fields must be present. Do not specify read-only fields. | 
Response
The response is the full DKIM Key record as defined in the DKIM Key Attributes.
Example
POST /ga/api/v3/eng/dkim_keys
{
  "dkim_key": {
    "domain": "my-domain.com",
    "selector": "second",
    "default_for_domain": false,
    "key": {
      "private": "-----BEGIN RSA PRIVATE KEY-----\nMCwCAQACBQCpGuTBAgMBAAECBCt6no0CAwDd5wIDAMMXAgIotwICDVkCAwCGMg==\n-----END RSA PRIVATE KEY-----"
    }
  }
}
HTTP/1.1 200 OK
{
  "success": true,
  "data": {
    "dkim_key": {
      "id": 4,
      "domain": "my-domain.com",
      "selector": "second",
      "default_for_domain": false,
      "key": {
        "bits": 32,
        "private": "-----BEGIN RSA PRIVATE KEY-----\nMCwCAQACBQCpGuTBAgMBAAECBCt6no0CAwDd5wIDAMMXAgIotwICDVkCAwCGMg==\n-----END RSA PRIVATE KEY-----",
        "public": "MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKka5MECAwEAAQ"
      },
      "dns": {
        "public_key": {
          "name": "second._domainkey.my-domain.com",
          "type": "TXT",
          "value": "k=rsa; p=MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKka5MECAwEAAQ"
        }
      }
    }
  },
  "error_code": null,
  "error_messages": null
}
Update a DKIM Key
PUT /ga/api/v3/eng/dkim_keys/{id}
Payload
| dkim_key hash/ required | This hash is described in the Attributes section of this page. | 
Response
The response is the full DKIM Key record as defined in the DKIM Key Attributes.
Example
PUT /ga/api/v3/eng/dkim_keys/1
{
  "dkim_key": {
    "domain": "new-domain.com"
  }
}
HTTP/1.1 200 OK
{
  "success": true,
  "data": {
    "dkim_key": {
      "id": 1,
      "domain": "new-domain.com",
      "selector": "default",
      "default_for_domain": false,
      "key": {
        "bits": 32,
        "private": "-----BEGIN RSA PRIVATE KEY-----\nMC0CAQACBQCoJLcxAgMBAAECBBur+skCAwDfNwIDAMDXAgMAhSECAkWhAgMAyzU=\n-----END RSA PRIVATE KEY-----",
        "public": "MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKgktzECAwEAAQ"
      },
      "dns": {
        "public_key": {
          "name": "default._domainkey.new-domain.com",
          "type": "TXT",
          "value": "k=rsa; p=MCAwDQYJKoZIhvcNAQEBBQADDwAwDAIFAKgktzECAwEAAQ"
        }
      }
    }
  },
  "error_code": null,
  "error_messages": null
}
Delete a DKIM Key
DELETE /ga/api/v3/eng/dkim_keys/{id}
Response
The response is a standard success or error response.
Example
DELETE /ga/api/v3/eng/dkim_keys/2
HTTP/1.1 200 OK
{
  "success": true,
  "data": {
  },
  "error_code": null,
  "error_messages": null
}
