> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Port for Host Asset

> Retrieve a port for a host asset.




## OpenAPI

````yaml /asset-v2-openapi.yaml get /v2/assets/{assetUid}/ports/{portNumber}/{portProtocol}
openapi: 3.0.3
info:
  title: Asset Service
  version: 2.1.020
  contact:
    name: Synack Engineering
    email: engineering@synack.com
servers:
  - url: https://client.synack.com/api/asset
    description: Commercial
  - url: https://client.synack.us/api/asset
    description: FedRAMP (Medium)
security: []
tags:
  - name: asset-relationships
    description: Relationships between assets.
  - name: Assets
    description: Assets managed by Synack.
  - name: cloudaccounts
    description: Cloud account assets.
  - name: credentials
    description: Credentials are restricted to authorized users.
  - name: Hosts
    description: Host assets.
  - name: Assessments
    description: Assets are associated with listings.
  - name: mobileapps
    description: Mobile application assets.
  - name: networks
    description: Network assets.
  - name: ports
    description: Ports for single host assets.
  - name: scoperules
    description: >-
      Scope-rules provide fine grained control for what is in and out of scope
      for an asset.
  - name: scripts
    description: Scripts for mobile and web applications.
  - name: userroles
    description: Defines persona-specific user roles for asset credential management.
  - name: users
    description: Users of credentials.
  - name: webapps
    description: Web application assets.
paths:
  /v2/assets/{assetUid}/ports/{portNumber}/{portProtocol}:
    parameters:
      - $ref: '#/components/parameters/AssetUIDPath'
      - $ref: '#/components/parameters/PortNumberPath'
      - $ref: '#/components/parameters/PortProtocolPath'
    get:
      tags:
        - Assets
        - ports
      description: |
        Retrieve a port for a host asset.
      operationId: getHostPort
      responses:
        '200':
          $ref: '#/components/responses/SinglePort'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '503':
          $ref: '#/components/responses/503ServiceUnavailable'
      security:
        - OAuth2:
            - asset_gr
            - asset_or
            - asset_lr
components:
  parameters:
    AssetUIDPath:
      name: assetUid
      in: path
      schema:
        $ref: '#/components/schemas/AssetUID'
      required: true
      description: Unique identifier for an asset.
    PortNumberPath:
      name: portNumber
      in: path
      schema:
        $ref: '#/components/schemas/PortNumber'
      required: true
      description: Port number.
    PortProtocolPath:
      name: portProtocol
      in: path
      schema:
        $ref: '#/components/schemas/PortProtocol'
      required: true
      description: Port protocol.
  responses:
    SinglePort:
      description: The current state of a host port.
      headers:
        ETag:
          $ref: '#/components/headers/ETag'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Port'
    401Unauthorized:
      description: Unauthorized.
    403Forbidden:
      description: Forbidden
    404NotFound:
      description: Not found.
    503ServiceUnavailable:
      description: Service Unavailable.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  schemas:
    AssetUID:
      type: string
      pattern: ^[0-9a-f]{24}
      description: Unique identifier for an asset.
    PortNumber:
      type: integer
      format: int32
      minimum: 0
      maximum: 65535
    PortProtocol:
      type: string
      enum:
        - tcp
        - udp
    Port:
      allOf:
        - type: object
          required:
            - scope
            - observedState
          properties:
            number:
              $ref: '#/components/schemas/PortNumber'
            protocol:
              $ref: '#/components/schemas/PortProtocol'
            scope:
              $ref: '#/components/schemas/Scope'
            service:
              type: string
              description: >
                Name of (expected) service running on port. Will use the
                [Service Name and Transport Protocol Port Number
                Registry](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
                for well-known ports.
            observedState:
              $ref: '#/components/schemas/PortObservedState'
            detectedService:
              type: string
              description: >
                Name of detected service running on port according to
                fingerprinting.
              readOnly: true
            detectedProductName:
              type: string
              description: >
                Name of software product running on port according to
                fingerprinting.
              readOnly: true
            detectedProductVersion:
              type: string
              description: >-
                Version of software product running on port according to
                fingerprinting.
              readOnly: true
            detectedProductConfidenceLevel:
              type: integer
              format: int
              minimum: 1
              maximum: 10
              description: >-
                Confidence level of detected product on port according to
                fingerprinting.
              readOnly: true
            detectedProductCPE:
              type: string
              description: |
                CPE for detected product according to fingerprinting.
              readOnly: true
            serviceBanner:
              type: string
              description: Port banner according to fingerprinting.
              readOnly: true
        - $ref: '#/components/schemas/Updatable'
    ProblemDetails:
      type: object
      description: >-
        See [RFC 7807: Problem Details for HTTP
        APIs](https://tools.ietf.org/html/rfc7807)
      properties:
        type:
          type: string
          readOnly: true
        title:
          type: string
          readOnly: true
        status:
          type: integer
          format: int32
          minimum: 100
          maximum: 511
          description: HTTP Status code.
          readOnly: true
        detail:
          type: string
          description: Message detailing the problem.
          readOnly: true
        instance:
          type: string
          description: generated problem instance number to correlate with logs
          readOnly: true
        failedValidation:
          type: array
          description: Array of failed validation rules.
          readOnly: true
          items:
            $ref: '#/components/schemas/FailedValidation'
        failedValidations:
          type: array
          description: Array of indexed failed validation rules.
          readOnly: true
          items:
            $ref: '#/components/schemas/IndexedFailedValidations'
        maxBatchSize:
          type: integer
          description: Maximum processable batch size.
          readOnly: true
        batchSize:
          type: integer
          description: Batch size sent when batch is too large.
          readOnly: true
    Scope:
      description: >
        Set to _in_-scope means automated and manual testing _should_ occur;
        _out_-of-scope means automated and manual testing _must not_ occur;
        _discovered_ means observed through automated discovery and may be
        automatically removed if not observed again during subseqent discovery
        activities.
      type: string
      enum:
        - in
        - out
        - discovered
        - blocked
    PortObservedState:
      type: string
      enum:
        - open
        - closed
        - filtered
      description: Observed state reported by automated scanning.
    Updatable:
      allOf:
        - $ref: '#/components/schemas/Creatable'
        - type: object
          properties:
            updatedAt:
              type: string
              format: date-time
              readOnly: true
              description: >-
                Automatically set by the server to the time the request was
                processed whenever the resource is updated.
            updatedBy:
              $ref: '#/components/schemas/OperationUserUID'
    FailedValidation:
      type: object
      required:
        - message
      properties:
        property:
          type: string
          readOnly: true
        value:
          type: string
          readOnly: true
        message:
          type: string
          readOnly: true
    IndexedFailedValidations:
      type: object
      properties:
        index:
          type: integer
          description: >-
            Zero-based index indicating the which item in request containing an
            array of items has failed validation.
          readOnly: true
        failedValidation:
          type: array
          description: Array of failed validation rules.
          readOnly: true
          items:
            $ref: '#/components/schemas/FailedValidation'
    Creatable:
      type: object
      required:
        - createdAt
        - createdBy
      properties:
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: >-
            Automatically set by the server to the time the request was
            processed whenever the resource was created.
        createdBy:
          $ref: '#/components/schemas/OperationUserUID'
    OperationUserUID:
      type: string
      pattern: ^[0-9a-f]{12}
      readOnly: true
      description: >-
        Automatically set by the server to the requesting user whenever the
        resource is updated. May be a user account or a service account if the
        action is performed by an automated.
  headers:
    ETag:
      description: An identifier for a specific version of a resource
      schema:
        type: string
        pattern: ^(?:W\/)?\".*\"$
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: login.synack.com
          scopes:
            asset_lr: Grants per-listing read access for all types of assets.
            asset_srt_lr: Grants per-listing read access to assets that may be read by SRTs.
            asset_or: >-
              Grants organization-level read access for all types of assets
              owned by a particular organization.
            asset_boss_ow: >-
              Grants organization-level access to assets owned by a particular
              organization that may be modified by BOSS users.
            asset_boss_lw: >-
              Grants per-listing write access to assets that may be modified by
              BOSS users.
            asset_client_ow: >-
              Grants organization-level access to assets owned by a particular
              organization that may be modified by Client users.
            asset_client_lw: >-
              Grants per-listing write access to assets that may be modified by
              Client users.
            asset_user_or: >-
              Grants user-level read access to asset stats that owned by a
              particular organization.
            asset_gr: >-
              Grants unrestricted read access to all assets. Except for
              credential data of cloud accout assets.
            asset_gw: Grants unrestricted write access to all assets.
            asset_scan_gr: >-
              Grants unrestricted read access to all assets. Including
              credential data of cloud account assets.

````