Fence Portfolio declarations API

Create and process asset portfolio declarations.

Operations 4

POST /v2/portfolio_declarations/ Create a portfolio declaration #
POST /v2/portfolio_declarations/{portfolio_declaration_id}/assets Add assets to a portfolio declaration #
POST /v2/portfolio_declarations/{portfolio_declaration_id}/declare Trigger a portfolio declaration #
POST /v2/declarations Create a fast-track declaration #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/fence:fence-portfolio-declarations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

fence-portfolio-declarations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Fence Partner Integration Portfolio declarations API
  version: '2.0'
  description: Machine-readable contract for the Fence API operations documented for integration partners. Access requires credentials provisioned by Fence during onboarding. Deal-specific asset fields are agreed separately and remain explicitly extensible in this contract. The current public API uses the /v2 major-version path. Compatible additive changes may be introduced within a major version; a change that breaks a documented integration requires a new major version. No operation in this description is currently announced for deprecation.
  contact:
    name: Fence
    url: https://fence.finance/contact/
    email: hello@fence.finance
servers:
- url: https://dev-api.fence.finance
  description: Sandbox API for integration testing. Requires sandbox credentials provisioned by Fence.
- url: https://api.fence.finance
  description: Production API. Requires production credentials provisioned by Fence.
security:
- OAuth2ClientCredentials: []
tags:
- name: Portfolio declarations
  description: Create and process asset portfolio declarations.
paths:
  /v2/portfolio_declarations/:
    post:
      tags:
      - Portfolio declarations
      operationId: createPortfolioDeclaration
      summary: Create a portfolio declaration
      description: Create an empty portfolio declaration for a deal before adding assets and triggering processing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePortfolioDeclarationRequest'
      responses:
        '201':
          description: Portfolio declaration created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioDeclaration'
        '401':
          description: A valid bearer access token is required.
          headers:
            WWW-Authenticate:
              description: Bearer authentication challenge.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '403':
          description: The client is not authorized for this deal or action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '404':
          description: The requested deal or resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '422':
          description: The request did not satisfy validation rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
  /v2/portfolio_declarations/{portfolio_declaration_id}/assets:
    parameters:
    - $ref: '#/components/parameters/PortfolioDeclarationId'
    post:
      tags:
      - Portfolio declarations
      operationId: addPortfolioDeclarationAssets
      summary: Add assets to a portfolio declaration
      description: Add a batch of deal-specific assets to an existing portfolio declaration. A request may contain at most 50,000 assets.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              maxItems: 50000
              items:
                $ref: '#/components/schemas/DealSpecificAsset'
      responses:
        '201':
          description: Assets added to the portfolio declaration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAssetsResponse'
        '400':
          description: The request could not be processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '401':
          description: A valid bearer access token is required.
          headers:
            WWW-Authenticate:
              description: Bearer authentication challenge.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '403':
          description: The client is not authorized for this deal or action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '404':
          description: The requested deal or resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '409':
          description: The resource state does not allow this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '422':
          description: The request did not satisfy validation rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
  /v2/portfolio_declarations/{portfolio_declaration_id}/declare:
    parameters:
    - $ref: '#/components/parameters/PortfolioDeclarationId'
    post:
      tags:
      - Portfolio declarations
      operationId: declarePortfolioDeclaration
      summary: Trigger a portfolio declaration
      description: Queue an existing portfolio declaration for asynchronous validation and processing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeclarePortfolioDeclarationRequest'
      responses:
        '202':
          description: Declaration accepted for asynchronous processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeclarePortfolioDeclarationResponse'
          links:
            GetDeclarationRun:
              operationId: getDeclarationRun
              parameters:
                declaration_id: $response.body#/id
              description: Poll this operation to monitor the accepted declaration run.
        '401':
          description: A valid bearer access token is required.
          headers:
            WWW-Authenticate:
              description: Bearer authentication challenge.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '403':
          description: The client is not authorized for this deal or action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '404':
          description: The requested deal or resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '409':
          description: The resource state does not allow this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '422':
          description: The request did not satisfy validation rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
  /v2/declarations:
    post:
      tags:
      - Portfolio declarations
      operationId: createFastTrackDeclaration
      summary: Create a fast-track declaration
      description: Create a portfolio declaration, add its deal-specific assets, and queue it for processing in one request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FastTrackDeclarationRequest'
      responses:
        '202':
          description: Declaration accepted for asynchronous processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeclarePortfolioDeclarationResponse'
          links:
            GetDeclarationRun:
              operationId: getDeclarationRun
              parameters:
                declaration_id: $response.body#/id
              description: Poll this operation to monitor the accepted declaration run.
        '400':
          description: The request could not be processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '401':
          description: A valid bearer access token is required.
          headers:
            WWW-Authenticate:
              description: Bearer authentication challenge.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '403':
          description: The client is not authorized for this deal or action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '404':
          description: The requested deal or resource was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '422':
          description: The request did not satisfy validation rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
components:
  schemas:
    DeclarePortfolioDeclarationResponse:
      type: object
      additionalProperties: false
      required:
      - id
      - status
      - dry_run
      properties:
        id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/DeclarationRunStatus'
        dry_run:
          type: boolean
    DealSpecificAsset:
      type: object
      minProperties: 1
      description: Asset payload validated against the schema configured for the target deal. Common integrations use external_id, contract_external_id, and properties; Fence provides the authoritative deal-specific fields during onboarding.
      properties:
        external_id:
          type: string
          minLength: 1
          description: Client-controlled asset identifier when required by the deal schema.
        contract_external_id:
          type:
          - string
          - 'null'
          minLength: 1
        properties:
          oneOf:
          - $ref: '#/components/schemas/DealSpecificProperties'
          - type: 'null'
      additionalProperties: true
    FastTrackDeclarationRequest:
      type: object
      additionalProperties: false
      required:
      - deal_id
      - assets
      properties:
        deal_id:
          type: string
          format: uuid
        dry_run:
          type: boolean
          default: false
        assets:
          type: array
          minItems: 1
          maxItems: 50000
          items:
            $ref: '#/components/schemas/DealSpecificAsset'
    ValidationIssue:
      type: object
      additionalProperties: true
      properties:
        loc:
          type: array
          items:
            oneOf:
            - type: string
            - type: integer
        msg:
          type: string
        type:
          type: string
    DealSpecificProperties:
      type: object
      description: Fields vary by deal and are defined in the integration-specific schema provided during onboarding.
      additionalProperties: true
    CreateAssetsResponse:
      type: object
      additionalProperties: false
      required:
      - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CreatedAsset'
    CreatedAsset:
      type: object
      additionalProperties: false
      required:
      - id
      - external_id
      properties:
        id:
          type: string
          format: uuid
        external_id:
          type: string
    DeclarePortfolioDeclarationRequest:
      type: object
      additionalProperties: false
      properties:
        dry_run:
          type: boolean
          default: false
    DeclarationRunStatus:
      type: string
      enum:
      - queued
      - processing
      - completed
      - completed_with_errors
      - failed
    CreatePortfolioDeclarationRequest:
      type: object
      additionalProperties: false
      required:
      - name
      - deal_id
      properties:
        name:
          type: string
          minLength: 1
        deal_id:
          type: string
          format: uuid
    HttpError:
      type: object
      additionalProperties: true
      required:
      - detail
      properties:
        detail:
          oneOf:
          - type: string
          - type: array
            items:
              $ref: '#/components/schemas/ValidationIssue'
          - type: object
            additionalProperties: true
    PortfolioDeclaration:
      type: object
      additionalProperties: false
      required:
      - id
      - deal_id
      - name
      - asset_count
      - created_at
      - updated_at
      properties:
        id:
          type: string
          format: uuid
        deal_id:
          type: string
          format: uuid
        name:
          type:
          - string
          - 'null'
        asset_count:
          type:
          - integer
          - 'null'
          minimum: 0
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  parameters:
    PortfolioDeclarationId:
      name: portfolio_declaration_id
      in: path
      required: true
      description: Portfolio declaration identifier.
      schema:
        type: string
        format: uuid
  securitySchemes:
    OAuth2ClientCredentials:
      type: oauth2
      description: OAuth 2.0 Client Credentials grant for server-to-server integrations. Fence provisions credentials separately for each environment.
      flows:
        clientCredentials:
          tokenUrl: /v1/login/access-token
          scopes: {}
externalDocs:
  description: Fence API Client Integration Guide
  url: https://docs.fence.finance/