---
updatedAt: 2026-09-05T01:44:39.000Z
agentTools:
  projectIndex: https://docs.pennsieve.io/llms.txt
---

# Registers an external compute resource account

Registers an external compute resource (such as AWS). The account has a role, created from Pennsieve's
CloudFormation template with a role setup from GET /role-policy?externalId=true, that the Pennsieve platform
can assume to deploy infrastructure for the compute nodes. The web app's "Connect AWS account" does this.
A registration without an external ID (the retired agent registration) is refused with 400.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "version": "3.0",
    "title": "Compute Resources API",
    "description": "This is the serverless Compute Resources API\n",
    "termsOfService": "https://docs.pennsieve.io/page/pennsieve-terms-of-use",
    "contact": {
      "name": "Pennsieve Support",
      "email": "support@pennsieve.net"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api2.pennsieve.io/compute/resources",
      "description": "Production server"
    },
    {
      "url": "https://api2.pennsieve.net/compute/resources",
      "description": "Development server"
    }
  ],
  "externalDocs": {
    "description": "Find more info here",
    "url": "https://docs.pennsieve.io"
  },
  "tags": [
    {
      "name": "Accounts",
      "description": "Registration and management of external cloud accounts that provide compute\nand/or storage capacity to the Pennsieve platform. An account must be\nregistered before a compute or storage node can be created in it.\n",
      "externalDocs": {
        "url": "https://docs.pennsieve.io/reference"
      }
    }
  ],
  "components": {
    "x-amazon-apigateway-integrations": {
      "account-service": {
        "type": "aws_proxy",
        "uri": "${account_service_lambda_arn}",
        "httpMethod": "POST",
        "passthroughBehavior": "when_no_match",
        "contentHandling": "CONVERT_TO_TEXT",
        "payloadFormatVersion": 2
      }
    },
    "securitySchemes": {
      "token_auth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-amazon-apigateway-authorizer": {
          "identitySource": "$request.header.Authorization",
          "authorizerUri": "${authorize_lambda_invoke_uri}",
          "authorizerPayloadFormatVersion": "2.0",
          "authorizerResultTtlInSeconds": 300,
          "type": "request",
          "enableSimpleResponses": true,
          "authorizerCredentials": "${gateway_authorizer_role}"
        }
      }
    },
    "schemas": {
      "accountRequest": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "the registered accountId"
          },
          "accountType": {
            "type": "string",
            "description": "the type of account"
          },
          "roleName": {
            "type": "string",
            "description": "the name of the created role"
          },
          "externalId": {
            "type": "string",
            "description": "required; the external ID Pennsieve issued with the role setup (GET /role-policy?externalId=true), to the user registering, for this role"
          },
          "templateVersion": {
            "type": "string",
            "description": "the CloudFormation template version the role was made from; with an externalId, records the account as connected with CloudFormation"
          },
          "name": {
            "type": "string",
            "description": "optional name for the account"
          },
          "description": {
            "type": "string",
            "description": "optional description for the account"
          }
        }
      },
      "postAccountsResponse": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "the uuid of the created compute resource account"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Incorrect authentication or user has incorrect permissions.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "Bad Request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Server Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/accounts": {
      "post": {
        "summary": "Registers an external compute resource account",
        "description": "Registers an external compute resource (such as AWS). The account has a role, created from Pennsieve's\nCloudFormation template with a role setup from GET /role-policy?externalId=true, that the Pennsieve platform\ncan assume to deploy infrastructure for the compute nodes. The web app's \"Connect AWS account\" does this.\nA registration without an external ID (the retired agent registration) is refused with 400.\n",
        "x-amazon-apigateway-integration": {
          "$ref": "#/components/x-amazon-apigateway-integrations/account-service"
        },
        "operationId": "postAccounts",
        "security": [
          {
            "token_auth": []
          }
        ],
        "tags": [
          "Accounts"
        ],
        "requestBody": {
          "description": "Payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/accountRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created compute resource account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/postAccountsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Unprocessable Entity - Account already exists for this user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "PostAccountsHandler: error records exists"
                    }
                  }
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}
```