# CaptureService

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/CaptureService/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/CaptureService

A service which provides control over screenshot and video capture features.

## Methods

### CanCaptureVideo

```luau
CaptureService:CanCaptureVideo(): boolean
```

- Tags: Roblox script security, Capabilities: Capture

### CaptureScreenshot

```luau
CaptureService:CaptureScreenshot(onCaptureReady: (...any) -> ...any)
```

- Tags: Capabilities: Capture

Takes a screenshot and provides a temporary `contentId` to identify it.

Parameters:

- `onCaptureReady`: A callback function that is called with the `contentId` of the new capture once it is ready.

### CheckMomentTextStatusAsync

```luau
CaptureService:CheckMomentTextStatusAsync(token: string): ...any
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### CheckUploadCaptureStatusAsync

```luau
CaptureService:CheckUploadCaptureStatusAsync(token: string): ...any
```

- Tags: Yields, Capabilities: Capture

Polls the status of an in-progress capture upload started by [`StartUploadCaptureAsync()`](https://rapi.sleaze.dev/classes/CaptureService.md).

Parameters:

- `token`: The token returned by [`StartUploadCaptureAsync()`](https://rapi.sleaze.dev/classes/CaptureService.md) that identifies the in-progress upload.

Returns: Tuple of (result: `UploadCaptureResult`, assetId: `number`)

### CheckUploadCaptureStatusForSupportTicketAsync

```luau
CaptureService:CheckUploadCaptureStatusForSupportTicketAsync(operationId: string): ...any
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### CreatePostAsync

```luau
CaptureService:CreatePostAsync(pathArr: { any }, caption: string): { [string]: any }
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### DeleteCapture

```luau
CaptureService:DeleteCapture(capturePath: string)
```

- Tags: Roblox script security, Capabilities: Capture

### DeleteCapturesAsync

```luau
CaptureService:DeleteCapturesAsync(pathArr: { any }): number
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### DeleteVideoCapture

```luau
CaptureService:DeleteVideoCapture(videoCapture: VideoCapture)
```

- Tags: Roblox script security, Capabilities: Capture

### DeleteVideoCaptureAsync

```luau
CaptureService:DeleteVideoCaptureAsync(videoCapture: VideoCapture): boolean
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GenerateMomentTextAsync

```luau
CaptureService:GenerateMomentTextAsync(capture: Capture, tone: string? = ""): ...any
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GetCaptureFilePathAsync

```luau
CaptureService:GetCaptureFilePathAsync(captureContent: Content): string
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GetCaptureSizeAsync

```luau
CaptureService:GetCaptureSizeAsync(captureContent: Content): Vector2
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GetCaptureStorageSizeAsync

```luau
CaptureService:GetCaptureStorageSizeAsync(pathArr: { any }): number
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GetCaptureUploadDataAsync

```luau
CaptureService:GetCaptureUploadDataAsync(capturePath: string): { [string]: any }
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### GetDeviceInfo

```luau
CaptureService:GetDeviceInfo(): { [string]: any }
```

- Tags: Capabilities: Capture + InternalTest

### GetScreenshotCaptureObject

```luau
CaptureService:GetScreenshotCaptureObject(capturePath: string): Capture
```

- Tags: Roblox script security, Capabilities: Capture

### InternalCheckPlayabilityAsync

```luau
CaptureService:InternalCheckPlayabilityAsync(universeId: number): boolean
```

- Tags: Yields, Capabilities: Capture + InternalTest

### InternalGetStartPlaceIdAsync

```luau
CaptureService:InternalGetStartPlaceIdAsync(universeId: number): number
```

- Tags: Yields, Capabilities: Capture + InternalTest

### IsCapturingVideo

```luau
CaptureService:IsCapturingVideo(): boolean
```

- Tags: Roblox script security, Capabilities: Capture

### OnCaptureBegan

```luau
CaptureService:OnCaptureBegan()
```

- Tags: Roblox script security, Capabilities: Capture

### OnCaptureEnded

```luau
CaptureService:OnCaptureEnded()
```

- Tags: Roblox script security, Capabilities: Capture

### OnCaptureObjectShared

```luau
CaptureService:OnCaptureObjectShared(capture: Capture)
```

- Tags: Roblox script security, Capabilities: Capture

### OnCapturePermissionsPromptFinished

```luau
CaptureService:OnCapturePermissionsPromptFinished(promptId: number, wasAccepted: boolean)
```

- Tags: Roblox script security, Capabilities: Capture

### OnCaptureShared

```luau
CaptureService:OnCaptureShared(capturePath: string)
```

- Tags: Roblox script security, Capabilities: Capture

### OnSavePromptFinished

```luau
CaptureService:OnSavePromptFinished(promptId: number, results: { [string]: any })
```

- Tags: Custom Lua state, Roblox script security, Capabilities: Capture

### OnSharePromptFinished

```luau
CaptureService:OnSharePromptFinished(promptId: number, accepted: boolean)
```

- Tags: Roblox script security, Capabilities: Capture

### OnVideoCaptureShared

```luau
CaptureService:OnVideoCaptureShared(videoCapture: VideoCapture)
```

- Tags: Roblox script security, Capabilities: Capture

### PreCaptureShared

```luau
CaptureService:PreCaptureShared(capture: Capture): string
```

- Tags: Roblox script security, Capabilities: Capture

### PreVideoCaptureShared

```luau
CaptureService:PreVideoCaptureShared(videoCapture: VideoCapture): string
```

- Tags: Roblox script security, Capabilities: Capture

### PromptCaptureGalleryPermissionAsync

```luau
CaptureService:PromptCaptureGalleryPermissionAsync(captureGalleryPermission: Enum.CaptureGalleryPermission): boolean
```

- Tags: Yields, Capabilities: Capture

Prompts the user for permission to access their local capture gallery.

Parameters:

- `captureGalleryPermission`: An `CaptureGalleryPermission` representing the type of access for which the user will be prompted.

Returns: A boolean representing whether or not the user has allowed access to their captures.

### PromptSaveCapturesToGallery

```luau
CaptureService:PromptSaveCapturesToGallery(captures: { any }, resultCallback: (...any) -> ...any)
```

- Tags: Capabilities: Capture

Prompts the user to save specified captures to their gallery.

Parameters:

- `captures`: An array of content IDs and/or [`Capture`](https://rapi.sleaze.dev/classes/Capture.md) objects.
- `resultCallback`: A callback function that will be invoked with a dictionary mapping each `contentId` and/or [`Capture`](https://rapi.sleaze.dev/classes/Capture.md) object to a boolean indicating if the user accepted saving that capture.

### PromptShareCapture

```luau
CaptureService:PromptShareCapture(captureContent: Content, launchData: string, onAcceptedCallback: (...any) -> ...any, onDeniedCallback: (...any) -> ...any)
```

- Tags: Capabilities: Capture

Prompts the user to share a specified capture.

Parameters:

- `captureContent`: A [`Content`](https://rapi.sleaze.dev/index/types/Content.md) containing a `contentId` or [`Capture`](https://rapi.sleaze.dev/classes/Capture.md) object.
- `launchData`: An optional string to include as launch data in the invite link.
- `onAcceptedCallback`: An optional callback function invoked if the user accepts sharing.
- `onDeniedCallback`: An optional callback function invoked if the user denies sharing.

### ReadCapturesFromGalleryAsync

```luau
CaptureService:ReadCapturesFromGalleryAsync(captureTypeFilters: { any }? = {}, readFromAllEligibleExperiences: boolean? = false): ...any
```

- Tags: Yields, Capabilities: Capture

Returns a paginated list of captures from the user's gallery.

Parameters:

- `captureTypeFilters`: An array of `CaptureType`.
- `readFromAllEligibleExperiences`: A boolean; default is `false`.

Returns: Tuple of (result: `ReadCapturesFromGalleryResult`, capturesPages: [`CapturesPages`](https://rapi.sleaze.dev/classes/CapturesPages.md))

### RetrieveCaptures

```luau
CaptureService:RetrieveCaptures(): { any }
```

- Tags: Roblox script security, Capabilities: Capture

### SaveCaptureObjectToExternalStorage

```luau
CaptureService:SaveCaptureObjectToExternalStorage(capture: Capture)
```

- Tags: Roblox script security, Capabilities: Capture

### SaveCapturesToExternalStorageAsync

```luau
CaptureService:SaveCapturesToExternalStorageAsync(pathArr: { any }): number
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### SaveCaptureToExternalStorage

```luau
CaptureService:SaveCaptureToExternalStorage(capturePath: string)
```

- Tags: Roblox script security, Capabilities: Capture

### SaveScreenshotCapture

```luau
CaptureService:SaveScreenshotCapture(additionalInfo: string? = "")
```

- Tags: Roblox script security, Capabilities: Capture

### SaveVideoCaptureToExternalStorage

```luau
CaptureService:SaveVideoCaptureToExternalStorage(videoCapture: VideoCapture)
```

- Tags: Roblox script security, Capabilities: Capture

### StartUploadCaptureAsync

```luau
CaptureService:StartUploadCaptureAsync(capture: Capture): ...any
```

- Tags: Yields, Capabilities: Capture

Begins uploading a capture to the asset system and returns a token used to poll the upload's status.

Parameters:

- `capture`: The [`Capture`](https://rapi.sleaze.dev/classes/Capture.md) to upload.

Returns: Tuple of (result: `UploadCaptureResult`, token: [`string`](https://rapi.sleaze.dev/index/types/string.md))

### StartUploadCaptureForSupportTicketAsync

```luau
CaptureService:StartUploadCaptureForSupportTicketAsync(capture: Capture): ...any
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### StartVideoCaptureAsync

```luau
CaptureService:StartVideoCaptureAsync(onCaptureReady: (...any) -> ...any, captureParams: { [string]: any }? = nil): Enum.VideoCaptureStartedResult
```

- Tags: Yields, Capabilities: Capture

Initiates a video capture recording.

Parameters:

- `onCaptureReady`: A callback function that is called on video capture completion with a `VideoCaptureResult` and, if successful, a [`VideoCapture`](https://rapi.sleaze.dev/classes/VideoCapture.md).
- `captureParams`: A dictionary of optional parameters that modify capture behavior. Currently non-operational.

Returns: A `VideoCaptureStartedResult` indicating whether the video recording started successfully.

### StartVideoCaptureForMCPAsync

```luau
CaptureService:StartVideoCaptureForMCPAsync(onCaptureReady: (...any) -> ...any): Enum.VideoCaptureStartedResult
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### StartVideoCaptureInternalAsync

```luau
CaptureService:StartVideoCaptureInternalAsync(): Enum.VideoCaptureStartedResult
```

- Tags: Yields, Roblox script security, Capabilities: Capture

### StopVideoCapture

```luau
CaptureService:StopVideoCapture()
```

- Tags: Capabilities: Capture

Ends a video capture initiated by [`StartVideoCaptureAsync()`](https://rapi.sleaze.dev/classes/CaptureService.md).

### StopVideoCaptureForMCP

```luau
CaptureService:StopVideoCaptureForMCP()
```

- Tags: Roblox script security, Capabilities: Capture

### StopVideoCaptureInternal

```luau
CaptureService:StopVideoCaptureInternal()
```

- Tags: Roblox script security, Capabilities: Capture

### TakeScreenshotCaptureAsync

```luau
CaptureService:TakeScreenshotCaptureAsync(onCaptureReady: (...any) -> ...any, captureParams: { [string]: any }? = nil)
```

- Tags: Capabilities: Capture

Initiates a screenshot capture.

Parameters:

- `onCaptureReady`: A callback function that is called on screenshot capture completion with a `ScreenshotCaptureResult` and, if successful, a [`ScreenshotCapture`](https://rapi.sleaze.dev/classes/ScreenshotCapture.md).
- `captureParams`: A dictionary that modifies capture behavior.

### UploadCaptureAndPostMoment

```luau
CaptureService:UploadCaptureAndPostMoment(capture: Capture, momentMetadata: { [string]: any }? = nil, feedRegistrationInfo: { [string]: any }? = nil)
```

- Tags: Roblox script security, Capabilities: Capture

### UploadCaptureAsync

```luau
CaptureService:UploadCaptureAsync(capture: Capture): ...any
```

- Tags: Yields, Capabilities: Capture

Uploads a capture to the asset system and returns the result and asset ID.

Parameters:

- `capture`: The [`Capture`](https://rapi.sleaze.dev/classes/Capture.md) to upload.

Returns: Tuple of (result: `UploadCaptureResult`, assetId: `number`)

### UploadPostAsync

```luau
CaptureService:UploadPostAsync(capture: Capture, postMetadata: { [string]: any }? = nil): { [string]: any }
```

- Tags: Yields, Roblox script security, Capabilities: Capture

## Events

### CaptureBegan

```luau
CaptureService.CaptureBegan: RBXScriptSignal<(captureType: Enum.CaptureType)>
```

- Tags: Capabilities: Capture

Fires immediately before a capture begins.

### CaptureEnded

```luau
CaptureService.CaptureEnded: RBXScriptSignal<(captureType: Enum.CaptureType)>
```

- Tags: Capabilities: Capture

Fires after a capture finishes.

### CaptureObjectSavedInternal

```luau
CaptureService.CaptureObjectSavedInternal: RBXScriptSignal<(capture: Capture, triggerSource: string)>
```

- Tags: Roblox script security, Capabilities: Capture

### CaptureSavedInternal

```luau
CaptureService.CaptureSavedInternal: RBXScriptSignal<(captureInfo: { [string]: any }, triggerSource: string)>
```

- Tags: Roblox script security, Capabilities: Capture

### OnCaptureAndMetadataSignatureResult

```luau
CaptureService.OnCaptureAndMetadataSignatureResult: RBXScriptSignal<(content: string, captureSignature: string, captureSignatureVersion: number, metadataSignature: string, metadataSignatureVersion: number)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Capture

### OpenCapturePermissionsPrompt

```luau
CaptureService.OpenCapturePermissionsPrompt: RBXScriptSignal<(promptId: number, captureGalleryPermission: Enum.CaptureGalleryPermission)>
```

- Tags: Roblox script security, Capabilities: Capture

### OpenSaveCapturesPrompt

```luau
CaptureService.OpenSaveCapturesPrompt: RBXScriptSignal<(promptId: number, captures: { any })>
```

- Tags: Roblox script security, Capabilities: Capture

### OpenShareCapturePrompt

```luau
CaptureService.OpenShareCapturePrompt: RBXScriptSignal<(promptId: number, captureContent: any, launchData: string)>
```

- Tags: Roblox script security, Capabilities: Capture

### RequestCaptureAndMetadataSignature

```luau
CaptureService.RequestCaptureAndMetadataSignature: RBXScriptSignal<(content: string, audioAssetIds: string)>
```

- Tags: Hidden, Roblox engine security, Capabilities: Capture

### UserCaptureSaved

```luau
CaptureService.UserCaptureSaved: RBXScriptSignal<(captureContentId: string)>
```

- Tags: Capabilities: Capture

Fires when the user saves a capture.

### UserVideoCaptureFailed

```luau
CaptureService.UserVideoCaptureFailed: RBXScriptSignal<(result: Enum.VideoCaptureResult)>
```

- Tags: Roblox script security, Capabilities: Capture

### UserVideoCaptureStartFailed

```luau
CaptureService.UserVideoCaptureStartFailed: RBXScriptSignal<(result: Enum.VideoCaptureStartedResult)>
```

- Tags: Roblox script security, Capabilities: Capture

### VideoCaptureInProgress

```luau
CaptureService.VideoCaptureInProgress: RBXScriptSignal<(isInProgress: boolean, captureTrigger: string)>
```

- Tags: Roblox script security, Capabilities: Capture

### CaptureSaved

```luau
CaptureService.CaptureSaved: RBXScriptSignal<(captureInfo: { [string]: any })>
```

- Tags: Deprecated, Capabilities: Capture
- Use instead: [`CaptureService.UserCaptureSaved`](https://rapi.sleaze.dev/classes/CaptureService.md)

**Deprecated:** This event has been superseded by the [`UserCaptureSaved`](https://rapi.sleaze.dev/classes/CaptureService.md) event.

Fires when a screenshot capture is saved to the user's gallery.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
