---
title: "Generate a suggested name or description for an API flow"
method: POST
path: "/generate/metadata/apiFlow"
tags: ["MetadataGeneration"]
---

# Generate a suggested name or description for an API flow

`POST /generate/metadata/apiFlow`

Generate a suggested name for an API flow based on the steps list

## Query parameters

- `workspaceId` string, required

## Request body

- ApiFlowMetadataGenerationRequest — Request to generate metadata for a reusable API flow
  - `stepsList` ApiTestStep[] — The list of steps in the API flow
    - `intent` string — The intent of this test interaction
    - `stepType` 'step_group' | 'assert_step' | 'flow' | 'api_test_step' — The type of step
    - `name` string — The name of the test step
    - `request` ApiTestStepRequestDefinition — The request definition for an API test step
      - `url` string — The URL to be called
      - `method` string — The HTTP method to be used
      - `header` ApiTestStepHeaderDefinition[] — The headers to be included in the request
        - `key` string — The header key
        - `value` string — The header value
      - `body` ApiTestStepRequestBodyDefinition — The body of the request
        - `mode` 'file' | 'formdata' | 'graphql' | 'none' | 'raw' | 'urlencoded' — The mode of the request body
        - `raw` string — The raw body content
        - `file` ApiTestFile — File data for the request body
          - `src` string — The src of the file (e.g., a file path or URL)
          - `mablFile` object
            - `id` string — The ID of the file in mabl
            - `type` string — The type of the file
            - `name` string — The name of the file
        - `formdata` ApiTestFormParamWithType[] — Form data parameters for the request body
          - `key` string — The key of the form parameter
          - `value` string — The value of the form parameter. Always an empty string for file form parameters.
          - `description` string — The description of the form parameter
          - `disabled` boolean — Whether the form parameter is disabled
          - `type` 'file' | 'text' — The type of the form parameter
        - `urlencoded` ApiTestFormParam[] — URL-encoded parameters for the request body
          - `key` string — The key of the form parameter
          - `value` string — The value of the form parameter. Always an empty string for file form parameters.
          - `description` string — The description of the form parameter
          - `disabled` boolean — Whether the form parameter is disabled
        - `graphql` object — The GraphQL query
          - `query` string — The GraphQL query
          - `variables` string — The GraphQL variables
      - `auth` ApiAuthentication — Configuration for API authentication
        - `type` 'apikey' | 'basic' | 'bearer' | 'noauth' | 'oauth1' | 'oauth2', required — The authentication type to use
        - `api_key` ApiKeyAuthentication — Configuration for API key authentication
          - `location` 'header' | 'query' — The location of the API key
          - `key` string — The key to use for authentication
          - `value` string — The value to use for authentication
        - `basic` BasicAuthentication — Configuration for basic authentication
          - `username` string — The username to use for authentication
          - `password` string — The password to use for authentication
        - `bearer` BearerAuthentication — Configuration for bearer authentication
          - `token` string — The token to use for authentication
        - `oauth1` OAuth1Authentication — Configuration for OAuth 1.0 authentication
          - `add_parameters_to_header` boolean
          - `add_empty_parameters_to_signature` boolean
          - `callback_url` string
          - `consumer_key` string
          - `consumer_secret` string
          - `include_body_hash` boolean
          - `nonce` string
          - `realm` string
          - `signature_method` 'HMAC-SHA1' | 'HMAC-SHA256' | 'HMAC-SHA512' | 'RSA-SHA1' | 'RSA-SHA256' | 'RSA-SHA512' | 'PLAINTEXT'
          - `timestamp` string
          - `token` string
          - `token_secret` string
          - `verifier` string
          - `version` string
        - `oauth2` OAuth2Authentication — Configuration for OAuth 2.0 authentication
          - `access_token_url` string, required
          - `client_credentials_location` 'basic_auth_header' | 'body', required
          - `client_id` string, required
          - `client_secret` string, required
          - `grant_type` 'client_credentials', required
          - `scope` string
          - `token_variable` string, required — The OAuth token will be stored to this variable
    - `assertions` ApiTestAssertion[] — A list of assertions for the API test step
      - `description` string — The description of the assertion
      - `assertTarget` 'Header' | 'JSONBody' | 'Size' | 'Status' | 'TextBody' — The target of the assertion
      - `assertType` 'Contains' | 'DoesNotContain' | 'EndsWith' | 'Equals' | 'GreaterThan' | 'GreaterThanOrEqualTo' | 'LessThan' | 'LessThanOrEqualTo' | 'MatchesRegExp' | 'NotEquals' | 'NotPresent' | 'Present' | 'StartsWith' — The type of assertion
      - `bodyPath` string — If asserting on the response body, the path to the value to assert against
      - `headerName` string — If asserting on a header, the name of the header
      - `value` string — The expected value for the assertion
      - `caseSensitive` boolean — Whether the assertion is case sensitive
    - `variables` ApiTestVariable[] — A list of variables to extract from the response for the API test step
      - `description` string — The description of the variable
      - `assertTarget` 'Header' | 'JSONBody' | 'Size' | 'Status' | 'TextBody' — What part of the response to extract the variable from
      - `bodyPath` string — If extracting from the response body, the path to the value to extract
      - `headerName` string — If extracting from a header, the name of the header
      - `variableName` string — The name of the variable
  - `variables` object — Key-value object containing the variables available for use in the API flow at the time of generation

## Response `200`

The generated metadata

- ApiFlowMetadataGenerationResponse — Response to a generation request for an API flow
  - `name` string — The generated name

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
