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

# Prime FIX 5.0 Session Management

> Session-level messages for the Coinbase Prime FIX 5.0 API.

<Info>In the tables below, the **Req** column indicates whether a field is required: `Y` = Required, `N` = Optional, `C` = Conditional on another field or product.</Info>

<Info>All messages on this page include the [standard header and trailer fields](./overview.mdx#standard-header).</Info>

<div className="fix-table">
  ## Session management messages

  ### Logon (A)

  Initiates a FIX session connection between your client and the server.

  | Tag  | Name             | Data Type | Req | Description                                                                                                                                                         |
  | :--- | :--------------- | :-------- | :-- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | 95   | RawDataLength    | Int       | Y   | Number of bytes in the RawData field                                                                                                                                |
  | 96   | RawData          | text      | Y   | Signature                                                                                                                                                           |
  | 98   | EncryptMethod    | Int       | Y   | `0` = None                                                                                                                                                          |
  | 108  | HeartBtInt       | Int       | Y   | Heartbeat interval in seconds (recommended: 30)                                                                                                                     |
  | 141  | ResetSeqNumFlag  | Boolean   | N   | `Y` = Reset sequence numbers to 1                                                                                                                                   |
  | 553  | Username         | String    | Y   | Client username for authentication                                                                                                                                  |
  | 554  | Password         | String    | Y   | Client password for authentication                                                                                                                                  |
  | 1137 | DefaultApplVerID | String    | Y   | `9` = FIX 5.0 Service Pack 2                                                                                                                                        |
  | 9406 | DropCopyFlag     | Char      | N   | `N` = Execution reports for orders from this session only; `Y` = Execution reports for all portfolio orders and fills (default). Market data sessions must use `N`. |

  ### Logout (5)

  Terminates a FIX session gracefully.

  | Tag | Name | Data Type | Req | Description                            |
  | :-- | :--- | :-------- | :-- | :------------------------------------- |
  | 58  | Text | String    | N   | Logout reason or informational message |

  ### Heartbeat (0)

  Maintains session connectivity and confirms system responsiveness.

  | Tag | Name      | Data Type | Req | Description                                                                             |
  | :-- | :-------- | :-------- | :-- | :-------------------------------------------------------------------------------------- |
  | 112 | TestReqID | String    | C   | Required if responding to TestRequest. Echo the TestReqID from the TestRequest message. |

  ### TestRequest (1)

  Validates session responsiveness when no messages are received within the HeartBtInt period.

  | Tag | Name      | Data Type | Req | Description                                                 |
  | :-- | :-------- | :-------- | :-- | :---------------------------------------------------------- |
  | 112 | TestReqID | String    | Y   | Unique identifier that must be echoed in Heartbeat response |

  ### Reject (3)

  Indicates session-level rejection of a received message.

  | Tag | Name                | Data Type | Req | Description                                                                                                                                                                                |
  | :-- | :------------------ | :-------- | :-- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | 45  | RefSeqNum           | Int       | Y   | MsgSeqNum of rejected message                                                                                                                                                              |
  | 371 | RefTagID            | Int       | C   | Tag number of the field with error                                                                                                                                                         |
  | 372 | RefMsgType          | String    | C   | MsgType of rejected message                                                                                                                                                                |
  | 373 | SessionRejectReason | Int       | C   | `0` = Invalid tag number<br />`1` = Required tag missing<br />`2` = Tag not defined<br />`3` = Undefined tag<br />`5` = Value incorrect<br />`6` = Incorrect data format<br />`99` = Other |
  | 58  | Text                | String    | N   | Human-readable description of rejection                                                                                                                                                    |

  ### ResendRequest (2)

  Requests retransmission of messages when a gap is detected in sequence numbers.

  | Tag | Name       | Data Type | Req | Description                                                         |
  | :-- | :--------- | :-------- | :-- | :------------------------------------------------------------------ |
  | 7   | BeginSeqNo | Int       | Y   | Starting sequence number for resend range                           |
  | 16  | EndSeqNo   | Int       | Y   | Ending sequence number (`0` = resend all messages after BeginSeqNo) |

  ### SequenceReset (4)

  Resets message sequence numbers or fills sequence gaps.

  | Tag | Name        | Data Type | Req | Description                                                            |
  | :-- | :---------- | :-------- | :-- | :--------------------------------------------------------------------- |
  | 123 | GapFillFlag | Boolean   | C   | `Y` = Gap fill mode (messages 34 through NewSeqNo-1 have been skipped) |
  | 36  | NewSeqNo    | Int       | Y   | New sequence number for next message                                   |
</div>
