Skip to content

xAI / Grok

The mappings below reflect observed export structures as of February 2026, verified against real export data. xAI does not natively support PAM. These mappings are best-effort compatibility guidance. Provider export formats may change without notice. Importers MUST be versioned.

  1. Go to grok.com → Account settings → Download your data
  2. Download and extract the ZIP file

The ZIP contains files under ttl/30d/export_data/<user_uuid>/:

FileDescription
prod-grok-backend.jsonMain file: conversations, projects, tasks, media posts
prod-mc-auth-mgmt-api.jsonUser profile and sessions
prod-mc-billing.jsonCredits balance
prod-mc-asset-server/Uploaded files referenced by asset UUID (code, images, PDFs, etc.)

Conversations are wrapped: each item is {"conversation": {...}, "responses": [...]}.

Provider fieldPAM fieldTransform
conversation.idprovider.conversation_iddirect
conversation.titletitledirect
conversation.create_timetemporal.created_atdirect (ISO 8601)
conversation.modify_timetemporal.updated_atdirect (ISO 8601)
conversation.user_idprovider.account_iddirect
conversation.starredraw_metadata.starredpreserve
conversation.system_prompt_nameraw_metadata.system_prompt_namepreserve
provider.namehardcode "grok"

Each response is wrapped: {"response": {...}, "share_link": {...}}.

Provider fieldPAM fieldTransform
response._idprovider_message_iddirect
response._ididgenerate UUID or use original
response.parent_response_idparent_idmap provider ID → PAM ID
children_idsreconstruct by inverting parent_response_id
response.senderrolesee Role Normalization
response.messagecontent.textdirect
response.create_timecreated_atBSON → datetime.fromtimestamp(int(v["$date"]["$numberLong"])/1000, tz=UTC).isoformat()
response.modelmodeldirect
response.cited_web_search_resultscitationsmap each {url, title, preview} to Citation {url, title, snippet} (previewsnippet)
response.generated_image_urlsattachmentsmap each URL to Attachment with type: "image"
response.file_attachmentsattachmentsmap each asset UUID
response.web_search_resultsraw_metadata.web_search_resultspreserve
response.thinking_traceraw_metadata.thinking_tracepreserve
response.thinking_start_timeraw_metadata.thinking_start_timepreserve
response.thinking_end_timeraw_metadata.thinking_end_timepreserve
response.agent_thinking_tracesraw_metadata.agent_thinking_tracespreserve
response.stepsraw_metadata.stepspreserve (tool execution chain)
response.queryraw_metadata.querypreserve
response.query_typeraw_metadata.query_typepreserve
response.xpost_idsraw_metadata.xpost_idspreserve
response.webpage_urlsraw_metadata.webpage_urlspreserve
response.card_attachments_jsonraw_metadata.card_attachments_jsonpreserve
response.errorraw_metadata.errorpreserve
response.metadataraw_metadata.grok_metadatapreserve (renamed to avoid collision)

Four distinct sender values have been observed: "human", "assistant", "ASSISTANT" (uppercase), and model names such as "grok-3". Normalization MUST be case-insensitive. Treat any value that is not "human" (case-insensitive) as "assistant".

Provider valuePAM normalized value
humanuser
assistantassistant
ASSISTANTassistant
grok-3 (model name)assistant
any non-human valueassistant

Grok uses two different timestamp formats within the same file:

LevelFormatTransform
ConversationISO 8601direct
MessageBSON {"$date":{"$numberLong":"<ms>"}}datetime.fromtimestamp(int(v["$date"]["$numberLong"])/1000, tz=UTC).isoformat()

Two separate parsers are needed for the same file.

  • Wrapper nesting: Every conversation is {conversation, responses} and every response is {response, share_link}. Must unwrap twice.
  • DAG structure: parent_response_id is present on most messages. Supports branching conversations. children_ids must be reconstructed by inverting parent references.
  • Empty messages: Some responses have message: "" (empty string). These are typically image generation responses where the content is in generated_image_urls.
  • Steps = tool use chain: steps[] contains structured tool execution with tagged_text and tool_usage_results. This is Grok’s equivalent of function calling. Preserve in raw_metadata.
  • Thinking traces: Two mechanisms — thinking_trace (inline string) and agent_thinking_traces[] (array). Both may be present on the same response. Preserve in raw_metadata.
  • Asset files: Uploads are stored as UUID-named directories in prod-mc-asset-server/, each containing a content file with no extension. Use content inspection to determine type.

PAM import support for Grok is provided by official SDK Converters maintained by the PAM project. See the Importing Guide for general import instructions and the Provider Overview for the full compatibility matrix.